@alfalab/core-components-select 14.1.2 → 14.3.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-3885b0d7.d.ts +1 -1
- package/{Component-00c64376.d.ts → Component-3eb05f44.d.ts} +48 -1
- package/{Component-00c64376.js → Component-3eb05f44.js} +26 -20
- package/Component.js +1 -1
- package/Component.mobile-b2c0420d.d.ts +93 -0
- package/Component.responsive.js +4 -3
- 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 +2 -2
- package/components/base-option/index.css +13 -13
- package/components/base-select/Component.js +2 -2
- package/components/base-select/index.css +8 -8
- package/components/base-select/index.js +1 -1
- package/components/base-select-mobile/Component.d.ts +24 -0
- package/components/base-select-mobile/Component.js +25 -7
- package/components/base-select-mobile/footer/Component.js +3 -3
- package/components/base-select-mobile/footer/index.css +5 -5
- package/components/base-select-mobile/index.css +10 -10
- package/components/base-select-mobile/index.js +1 -1
- 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 +9 -9
- package/components/index.js +5 -4
- 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/options-list/Component.js +3 -3
- package/components/options-list/index.css +9 -9
- package/components/select-mobile/Component.js +4 -3
- package/components/select-mobile/index.d.ts +1 -1
- package/components/select-mobile/index.js +4 -3
- package/components/select-modal-mobile/Component.js +4 -3
- package/components/select-modal-mobile/index.d.ts +1 -1
- package/components/select-modal-mobile/index.js +4 -3
- package/components/virtual-options-list/Component.js +4 -4
- package/components/virtual-options-list/index.css +15 -15
- package/cssm/Component-3885b0d7.d.ts +1 -1
- package/{modern/Component-0b711513.d.ts → cssm/Component-4727d474.d.ts} +48 -1
- package/cssm/{Component-f86f43e3.js → Component-4727d474.js} +25 -19
- package/cssm/Component.mobile-b2c0420d.d.ts +93 -0
- package/cssm/Component.responsive.js +3 -1
- package/cssm/components/base-option/Component.js +1 -1
- package/cssm/components/base-select-mobile/Component.d.ts +24 -0
- package/cssm/components/base-select-mobile/Component.js +23 -5
- package/cssm/components/base-select-mobile/footer/Component.js +2 -2
- package/cssm/components/index.js +4 -2
- package/cssm/components/option/Component.js +1 -1
- package/cssm/components/options-list/Component.js +2 -2
- package/cssm/components/select-mobile/Component.js +3 -1
- package/cssm/components/select-mobile/index.d.ts +1 -1
- package/cssm/components/select-mobile/index.js +3 -1
- package/cssm/components/select-modal-mobile/Component.js +3 -1
- package/cssm/components/select-modal-mobile/index.d.ts +1 -1
- package/cssm/components/select-modal-mobile/index.js +3 -1
- package/cssm/components/virtual-options-list/Component.js +3 -3
- package/{esm/hook-4b555174.d.ts → cssm/hook-b4e70cb0.d.ts} +15 -4
- package/cssm/index.js +4 -2
- package/cssm/mobile.d.ts +4 -0
- package/cssm/mobile.js +67 -0
- package/cssm/presets/index.d.ts +1 -1
- package/cssm/presets/index.js +3 -1
- package/cssm/presets/useSelectWithApply/hook.js +3 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +3 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/footer/index.module.css +0 -9
- package/cssm/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +11 -0
- package/cssm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +23 -0
- package/cssm/presets/useSelectWithApply/options-list-with-apply/header/index.module.css +22 -0
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +3 -1
- package/cssm/responsive.js +3 -1
- package/esm/Component-3885b0d7.d.ts +1 -1
- package/{cssm/Component-f86f43e3.d.ts → esm/Component-b436aedf.d.ts} +48 -1
- package/esm/{Component-2ff63ae2.js → Component-b436aedf.js} +26 -20
- package/esm/Component.js +1 -1
- package/esm/Component.mobile-b2c0420d.d.ts +93 -0
- package/esm/Component.responsive.js +4 -3
- 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 +2 -2
- package/esm/components/base-option/index.css +13 -13
- package/esm/components/base-select/Component.js +2 -2
- package/esm/components/base-select/index.css +8 -8
- package/esm/components/base-select/index.js +1 -1
- package/esm/components/base-select-mobile/Component.d.ts +24 -0
- package/esm/components/base-select-mobile/Component.js +26 -8
- package/esm/components/base-select-mobile/footer/Component.js +3 -3
- package/esm/components/base-select-mobile/footer/index.css +5 -5
- package/esm/components/base-select-mobile/index.css +10 -10
- package/esm/components/base-select-mobile/index.js +1 -1
- 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 +9 -9
- package/esm/components/index.js +5 -4
- 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/options-list/Component.js +3 -3
- package/esm/components/options-list/index.css +9 -9
- package/esm/components/select-mobile/Component.js +4 -3
- package/esm/components/select-mobile/index.d.ts +1 -1
- package/esm/components/select-mobile/index.js +4 -3
- package/esm/components/select-modal-mobile/Component.js +4 -3
- package/esm/components/select-modal-mobile/index.d.ts +1 -1
- package/esm/components/select-modal-mobile/index.js +4 -3
- package/esm/components/virtual-options-list/Component.js +4 -4
- package/esm/components/virtual-options-list/index.css +15 -15
- package/{cssm/hook-4b555174.d.ts → esm/hook-b4e70cb0.d.ts} +15 -4
- package/esm/index-3885b0d7.d.ts +1 -1
- package/esm/index.js +5 -4
- package/esm/mobile.d.ts +4 -0
- package/esm/mobile.js +41 -0
- package/esm/presets/index.d.ts +1 -1
- package/esm/presets/index.js +4 -3
- package/esm/presets/useLazyLoading/hook.js +2 -2
- package/esm/presets/useLazyLoading/index.css +2 -2
- package/esm/presets/useSelectWithApply/hook.js +4 -3
- package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +4 -3
- 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 -12
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +11 -0
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +15 -0
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/index.css +23 -0
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +4 -3
- package/esm/presets/useSelectWithLoading/hook.js +1 -1
- package/esm/presets/useSelectWithLoading/index.css +2 -2
- package/esm/responsive.js +4 -3
- package/{hook-4b555174.d.ts → hook-b4e70cb0.d.ts} +15 -4
- package/index-3885b0d7.d.ts +1 -1
- package/index.js +5 -4
- package/mobile.d.ts +4 -0
- package/mobile.js +50 -0
- package/modern/Component-3885b0d7.d.ts +1 -1
- package/{esm/Component-2ff63ae2.d.ts → modern/Component-c22703bb.d.ts} +48 -1
- package/modern/{Component-0b711513.js → Component-c22703bb.js} +31 -17
- package/modern/Component.js +1 -1
- package/modern/Component.mobile-b2c0420d.d.ts +93 -0
- package/modern/Component.responsive.js +4 -3
- 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 +2 -2
- package/modern/components/base-option/index.css +13 -13
- package/modern/components/base-select/Component.js +2 -2
- package/modern/components/base-select/index.css +8 -8
- package/modern/components/base-select/index.js +1 -1
- package/modern/components/base-select-mobile/Component.d.ts +24 -0
- package/modern/components/base-select-mobile/Component.js +20 -7
- package/modern/components/base-select-mobile/footer/Component.js +3 -3
- package/modern/components/base-select-mobile/footer/index.css +5 -5
- package/modern/components/base-select-mobile/index.css +10 -10
- package/modern/components/base-select-mobile/index.js +1 -1
- 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 +9 -9
- package/modern/components/index.js +5 -4
- package/modern/components/optgroup/Component.js +1 -1
- package/modern/components/optgroup/index.css +6 -6
- package/modern/components/option/Component.js +2 -2
- package/modern/components/option/index.css +20 -20
- package/modern/components/options-list/Component.js +3 -3
- package/modern/components/options-list/index.css +9 -9
- package/modern/components/select-mobile/Component.js +4 -3
- package/modern/components/select-mobile/index.d.ts +1 -1
- package/modern/components/select-mobile/index.js +4 -3
- package/modern/components/select-modal-mobile/Component.js +4 -3
- package/modern/components/select-modal-mobile/index.d.ts +1 -1
- package/modern/components/select-modal-mobile/index.js +4 -3
- package/modern/components/virtual-options-list/Component.js +3 -3
- package/modern/components/virtual-options-list/index.css +15 -15
- package/modern/{hook-4b555174.d.ts → hook-b4e70cb0.d.ts} +15 -4
- package/modern/index-3885b0d7.d.ts +1 -1
- package/modern/index.js +5 -4
- package/modern/mobile.d.ts +4 -0
- package/modern/mobile.js +40 -0
- package/modern/presets/index.d.ts +1 -1
- package/modern/presets/index.js +4 -3
- package/modern/presets/useLazyLoading/hook.js +2 -2
- package/modern/presets/useLazyLoading/index.css +2 -2
- package/modern/presets/useSelectWithApply/hook.js +4 -3
- package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +4 -3
- 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 -12
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +11 -0
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.js +11 -0
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/index.css +23 -0
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +4 -3
- package/modern/presets/useSelectWithLoading/hook.js +1 -1
- package/modern/presets/useSelectWithLoading/index.css +2 -2
- package/modern/responsive.js +4 -3
- package/package.json +6 -6
- package/presets/index.d.ts +1 -1
- package/presets/index.js +4 -3
- package/presets/useLazyLoading/hook.js +2 -2
- package/presets/useLazyLoading/index.css +2 -2
- package/presets/useSelectWithApply/hook.js +4 -3
- package/presets/useSelectWithApply/options-list-with-apply/Component.js +4 -3
- package/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -12
- package/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +11 -0
- package/presets/useSelectWithApply/options-list-with-apply/header/Component.js +24 -0
- package/presets/useSelectWithApply/options-list-with-apply/header/index.css +23 -0
- package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/index.js +4 -3
- package/presets/useSelectWithLoading/hook.js +1 -1
- package/presets/useSelectWithLoading/index.css +2 -2
- package/responsive.js +4 -3
- /package/esm/{getDataTestId-d8d91b2e.d.ts → getDataTestId-416fe68c.d.ts} +0 -0
- /package/esm/{getDataTestId-d8d91b2e.js → getDataTestId-416fe68c.js} +0 -0
- /package/esm/{intersection-observer-210062db.d.ts → intersection-observer-71fc11ef.d.ts} +0 -0
- /package/esm/{intersection-observer-210062db.js → intersection-observer-71fc11ef.js} +0 -0
- /package/{getDataTestId-d8391785.d.ts → getDataTestId-e8d9eb23.d.ts} +0 -0
- /package/{getDataTestId-d8391785.js → getDataTestId-e8d9eb23.js} +0 -0
- /package/{intersection-observer-131fbe35.d.ts → intersection-observer-c227d471.d.ts} +0 -0
- /package/{intersection-observer-131fbe35.js → intersection-observer-c227d471.js} +0 -0
- /package/modern/{getDataTestId-b301a7a9.d.ts → getDataTestId-03736ddc.d.ts} +0 -0
- /package/modern/{getDataTestId-b301a7a9.js → getDataTestId-03736ddc.js} +0 -0
- /package/modern/{intersection-observer-210062db.d.ts → intersection-observer-71fc11ef.d.ts} +0 -0
- /package/modern/{intersection-observer-210062db.js → intersection-observer-71fc11ef.js} +0 -0
|
@@ -30,7 +30,7 @@ var BaseOption = function (_a) {
|
|
|
30
30
|
return null;
|
|
31
31
|
};
|
|
32
32
|
return (React__default.default.createElement("div", tslib.__assign({}, innerProps, { className: cn__default.default(styles__default.default.option, className, (_b = {},
|
|
33
|
-
_b[styles__default.default.highlighted] = highlighted,
|
|
33
|
+
_b[styles__default.default.highlighted] = !mobile && highlighted,
|
|
34
34
|
_b[styles__default.default.selected] = selected,
|
|
35
35
|
_b[styles__default.default.disabled] = disabled,
|
|
36
36
|
_b[styles__default.default.textContent] = isTextContent,
|
|
@@ -22,6 +22,18 @@ type SelectMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> & {
|
|
|
22
22
|
* Дополнительные пропсы шторки
|
|
23
23
|
*/
|
|
24
24
|
bottomSheetProps?: Partial<BottomSheetProps>;
|
|
25
|
+
/**
|
|
26
|
+
* Дополнительные пропсы модалки
|
|
27
|
+
*/
|
|
28
|
+
modalProps?: Partial<React.ComponentProps<typeof ModalMobile>>;
|
|
29
|
+
/**
|
|
30
|
+
* Дополнительные пропсы шапки модалки
|
|
31
|
+
*/
|
|
32
|
+
modalHeaderProps?: Partial<React.ComponentProps<typeof ModalMobile.Header>>;
|
|
33
|
+
/**
|
|
34
|
+
* Дополнительные пропсы футера модалки
|
|
35
|
+
*/
|
|
36
|
+
modalFooterProps?: Partial<React.ComponentProps<typeof ModalMobile.Footer>>;
|
|
25
37
|
};
|
|
26
38
|
declare const BaseSelectMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "Checkmark"> & {
|
|
27
39
|
/**
|
|
@@ -42,5 +54,17 @@ declare const BaseSelectMobile: React.ForwardRefExoticComponent<Omit<BaseSelectP
|
|
|
42
54
|
* Дополнительные пропсы шторки
|
|
43
55
|
*/
|
|
44
56
|
bottomSheetProps?: Partial<BottomSheetProps> | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Дополнительные пропсы модалки
|
|
59
|
+
*/
|
|
60
|
+
modalProps?: Partial<import("../../Component.mobile-b2c0420d").ModalMobileProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Дополнительные пропсы шапки модалки
|
|
63
|
+
*/
|
|
64
|
+
modalHeaderProps?: Partial<import("../../Component.mobile-b2c0420d").HeaderProps> | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Дополнительные пропсы футера модалки
|
|
67
|
+
*/
|
|
68
|
+
modalFooterProps?: Partial<import("../../Component.mobile-b2c0420d").FooterProps> | undefined;
|
|
45
69
|
} & React.RefAttributes<unknown>>;
|
|
46
70
|
export { SelectMobileProps, BaseSelectMobile };
|
|
@@ -45,11 +45,12 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
|
45
45
|
|
|
46
46
|
var BaseSelectMobile = React.forwardRef(function (_a, ref) {
|
|
47
47
|
var _b;
|
|
48
|
-
var dataTestId = _a.dataTestId, className = _a.className, fieldClassName = _a.fieldClassName, optionsListClassName = _a.optionsListClassName, optionClassName = _a.optionClassName, optionGroupClassName = _a.optionGroupClassName, optionsListProps = _a.optionsListProps, _c = _a.options, options = _c === void 0 ? [] : _c, _d = _a.autocomplete, autocomplete = _d === void 0 ? false : _d, _e = _a.multiple, multiple = _e === void 0 ? false : _e, _f = _a.allowUnselect, allowUnselect = _f === void 0 ? false : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.closeOnSelect, closeOnSelect = _h === void 0 ? !multiple : _h, _j = _a.circularNavigation, circularNavigation = _j === void 0 ? false : _j, _k = _a.defaultOpen, defaultOpen = _k === void 0 ? false : _k, openProp = _a.open, _l = _a.optionsListWidth, optionsListWidth = _l === void 0 ? 'content' : _l, name = _a.name, id = _a.id, _m = _a.selected, selected = _m === void 0 ? [] : _m, _o = _a.size, size = _o === void 0 ? 'm' : _o, _p = _a.optionsSize, optionsSize = _p === void 0 ? 'm' : _p, error = _a.error, hint = _a.hint, block = _a.block, label = _a.label, labelView = _a.labelView, placeholder = _a.placeholder, _q = _a.fieldProps, fieldProps = _q === void 0 ? {} : _q, _r = _a.optionProps, optionProps = _r === void 0 ? {} : _r, valueRenderer = _a.valueRenderer, onChange = _a.onChange, onOpen = _a.onOpen, onFocus = _a.onFocus, _s = _a.Arrow, Arrow = _s === void 0 ? components_arrow_Component.Arrow : _s, _t = _a.Field, Field = _t === void 0 ? components_field_Component.Field : _t, _u = _a.Optgroup, Optgroup = _u === void 0 ? components_optgroup_Component.Optgroup : _u, _v = _a.Option, Option = _v === void 0 ? components_option_Component.Option : _v, _w = _a.OptionsList, OptionsList = _w === void 0 ? components_optionsList_Component.OptionsList : _w, swipeable = _a.swipeable, footer = _a.footer, isBottomSheet = _a.isBottomSheet, bottomSheetProps = _a.bottomSheetProps, _x = _a.showEmptyOptionsList, showEmptyOptionsList = _x === void 0 ? false : _x;
|
|
48
|
+
var dataTestId = _a.dataTestId, className = _a.className, fieldClassName = _a.fieldClassName, optionsListClassName = _a.optionsListClassName, optionClassName = _a.optionClassName, optionGroupClassName = _a.optionGroupClassName, optionsListProps = _a.optionsListProps, _c = _a.options, options = _c === void 0 ? [] : _c, _d = _a.autocomplete, autocomplete = _d === void 0 ? false : _d, _e = _a.multiple, multiple = _e === void 0 ? false : _e, _f = _a.allowUnselect, allowUnselect = _f === void 0 ? false : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.closeOnSelect, closeOnSelect = _h === void 0 ? !multiple : _h, _j = _a.circularNavigation, circularNavigation = _j === void 0 ? false : _j, _k = _a.defaultOpen, defaultOpen = _k === void 0 ? false : _k, openProp = _a.open, _l = _a.optionsListWidth, optionsListWidth = _l === void 0 ? 'content' : _l, name = _a.name, id = _a.id, _m = _a.selected, selected = _m === void 0 ? [] : _m, _o = _a.size, size = _o === void 0 ? 'm' : _o, _p = _a.optionsSize, optionsSize = _p === void 0 ? 'm' : _p, error = _a.error, hint = _a.hint, block = _a.block, label = _a.label, labelView = _a.labelView, placeholder = _a.placeholder, _q = _a.fieldProps, fieldProps = _q === void 0 ? {} : _q, _r = _a.optionProps, optionProps = _r === void 0 ? {} : _r, valueRenderer = _a.valueRenderer, onChange = _a.onChange, onOpen = _a.onOpen, onFocus = _a.onFocus, _s = _a.Arrow, Arrow = _s === void 0 ? components_arrow_Component.Arrow : _s, _t = _a.Field, Field = _t === void 0 ? components_field_Component.Field : _t, _u = _a.Optgroup, Optgroup = _u === void 0 ? components_optgroup_Component.Optgroup : _u, _v = _a.Option, Option = _v === void 0 ? components_option_Component.Option : _v, _w = _a.OptionsList, OptionsList = _w === void 0 ? components_optionsList_Component.OptionsList : _w, swipeable = _a.swipeable, footer = _a.footer, isBottomSheet = _a.isBottomSheet, bottomSheetProps = _a.bottomSheetProps, modalProps = _a.modalProps, modalHeaderProps = _a.modalHeaderProps, modalFooterProps = _a.modalFooterProps, _x = _a.showEmptyOptionsList, showEmptyOptionsList = _x === void 0 ? false : _x;
|
|
49
49
|
var rootRef = React.useRef(null);
|
|
50
50
|
var fieldRef = React.useRef(null);
|
|
51
51
|
var listRef = React.useRef(null);
|
|
52
52
|
var initiatorRef = React.useRef(null);
|
|
53
|
+
var alreadyClickedRef = React.useRef(false);
|
|
53
54
|
var itemToString = function (option) { return (option ? option.key : ''); };
|
|
54
55
|
var _y = React.useMemo(function () { return utils.processOptions(options, selected); }, [options, selected]), flatOptions = _y.flatOptions, selectedOptions = _y.selectedOptions;
|
|
55
56
|
var scrollableContainerRef = React.useRef(null);
|
|
@@ -113,7 +114,12 @@ var BaseSelectMobile = React.forwardRef(function (_a, ref) {
|
|
|
113
114
|
case downshift.useCombobox.stateChangeTypes.InputKeyDownEnter:
|
|
114
115
|
case downshift.useCombobox.stateChangeTypes.ItemClick:
|
|
115
116
|
initiatorRef.current = selectedItem;
|
|
116
|
-
if (selectedItem && !selectedItem.disabled) {
|
|
117
|
+
if (selectedItem && !selectedItem.disabled && !alreadyClickedRef.current) {
|
|
118
|
+
alreadyClickedRef.current = true;
|
|
119
|
+
// TODO!!! Проблема downshift + React 18. ItemClick срабатывает дважды. См https://github.com/downshift-js/downshift/issues/1384
|
|
120
|
+
setTimeout(function () {
|
|
121
|
+
alreadyClickedRef.current = false;
|
|
122
|
+
});
|
|
117
123
|
var alreadySelected = selectedItems.includes(selectedItem);
|
|
118
124
|
var allowRemove = allowUnselect || (multiple && selectedItems.length > 1);
|
|
119
125
|
if (alreadySelected && allowRemove) {
|
|
@@ -221,9 +227,21 @@ var BaseSelectMobile = React.forwardRef(function (_a, ref) {
|
|
|
221
227
|
: undefined,
|
|
222
228
|
}, dataTestId: getDataTestId.getDataTestId(dataTestId, 'field') }, fieldProps)),
|
|
223
229
|
name && renderValue(),
|
|
224
|
-
isBottomSheet ? (React__default.default.createElement(coreComponentsBottomSheet.BottomSheet, tslib.__assign({ open: open, onClose: handleClose, className: styles__default.default.sheet, contentClassName: styles__default.default.sheetContent, containerClassName: styles__default.default.sheetContainer, title: label || placeholder, actionButton: footer, stickyHeader: true, hasCloser: true, swipeable: swipeable, scrollableContainerRef: scrollableContainerRef }, bottomSheetProps), renderOptionsList())) : (React__default.default.createElement(mobile.ModalMobile, { open: open,
|
|
225
|
-
|
|
226
|
-
|
|
230
|
+
isBottomSheet ? (React__default.default.createElement(coreComponentsBottomSheet.BottomSheet, tslib.__assign({ open: open, onClose: handleClose, className: styles__default.default.sheet, contentClassName: styles__default.default.sheetContent, containerClassName: styles__default.default.sheetContainer, title: label || placeholder, actionButton: footer, stickyHeader: true, hasCloser: true, swipeable: swipeable, scrollableContainerRef: scrollableContainerRef }, bottomSheetProps), renderOptionsList())) : (React__default.default.createElement(mobile.ModalMobile, tslib.__assign({ open: open, hasCloser: true }, modalProps, { onClose: function () {
|
|
231
|
+
var _a;
|
|
232
|
+
var args = [];
|
|
233
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
234
|
+
args[_i] = arguments[_i];
|
|
235
|
+
}
|
|
236
|
+
handleClose();
|
|
237
|
+
(_a = modalProps === null || modalProps === void 0 ? void 0 : modalProps.onClose) === null || _a === void 0 ? void 0 : _a.call.apply(_a, tslib.__spreadArray([modalProps], args, false));
|
|
238
|
+
}, contentClassName: cn__default.default(styles__default.default.sheetContent, modalProps === null || modalProps === void 0 ? void 0 : modalProps.contentClassName), ref: mergeRefs__default.default([
|
|
239
|
+
scrollableContainerRef,
|
|
240
|
+
modalProps === null || modalProps === void 0 ? void 0 : modalProps.ref,
|
|
241
|
+
]) }),
|
|
242
|
+
React__default.default.createElement(mobile.ModalMobile.Header, tslib.__assign({ hasCloser: true, sticky: true }, modalHeaderProps), label || placeholder),
|
|
243
|
+
renderOptionsList(),
|
|
244
|
+
(modalFooterProps === null || modalFooterProps === void 0 ? void 0 : modalFooterProps.children) && React__default.default.createElement(mobile.ModalMobile.Footer, tslib.__assign({}, modalFooterProps))))));
|
|
227
245
|
});
|
|
228
246
|
|
|
229
247
|
exports.BaseSelectMobile = BaseSelectMobile;
|
|
@@ -26,8 +26,8 @@ var Footer = function (_a) {
|
|
|
26
26
|
tabIndex: 0, className: cn__default.default(styles__default.default.footer, (_b = {},
|
|
27
27
|
_b[styles__default.default.highlighted] = footerHighlighted,
|
|
28
28
|
_b)) },
|
|
29
|
-
React__default.default.createElement(coreComponentsButton.Button, { size: 's', view: '
|
|
30
|
-
|
|
29
|
+
showClear && (React__default.default.createElement(coreComponentsButton.Button, { size: 's', view: 'secondary', className: styles__default.default.button, onClick: handleClear }, "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C")),
|
|
30
|
+
React__default.default.createElement(coreComponentsButton.Button, { size: 's', view: 'primary', className: styles__default.default.button, onClick: handleApply }, "\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C")));
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
exports.Footer = Footer;
|
package/cssm/components/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var components_arrow_Component = require('./arrow/Component.js');
|
|
6
6
|
var components_baseSelect_Component = require('./base-select/Component.js');
|
|
7
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../Component-
|
|
7
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../Component-4727d474.js');
|
|
8
8
|
var components_field_Component = require('./field/Component.js');
|
|
9
9
|
var components_optgroup_Component = require('./optgroup/Component.js');
|
|
10
10
|
var components_option_Component = require('./option/Component.js');
|
|
@@ -26,6 +26,9 @@ require('../utils.js');
|
|
|
26
26
|
require('./native-select/Component.js');
|
|
27
27
|
require('./base-select/index.module.css');
|
|
28
28
|
require('../Component.js');
|
|
29
|
+
require('../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
30
|
+
require('@alfalab/core-components-checkbox/cssm');
|
|
31
|
+
require('../presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
|
|
29
32
|
require('./base-select-mobile/Component.js');
|
|
30
33
|
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
31
34
|
require('@alfalab/core-components-modal/cssm/mobile');
|
|
@@ -38,7 +41,6 @@ require('@alfalab/core-components-form-control/cssm');
|
|
|
38
41
|
require('./field/index.module.css');
|
|
39
42
|
require('./optgroup/index.module.css');
|
|
40
43
|
require('@alfalab/core-components-badge/cssm');
|
|
41
|
-
require('@alfalab/core-components-checkbox/cssm');
|
|
42
44
|
require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
|
|
43
45
|
require('@alfalab/icons-glyph/CheckmarkMIcon');
|
|
44
46
|
require('./checkmark/index.module.css');
|
|
@@ -27,7 +27,7 @@ var Option = function (_a) {
|
|
|
27
27
|
var content = children || option.content || option.key;
|
|
28
28
|
var _f = option.showCheckMark, showCheckMark = _f === void 0 ? true : _f;
|
|
29
29
|
return (React__default.default.createElement("div", tslib.__assign({}, innerProps, { className: cn__default.default(styles__default.default.option, styles__default.default[size], className, (_b = {},
|
|
30
|
-
_b[styles__default.default.highlighted] = highlighted,
|
|
30
|
+
_b[styles__default.default.highlighted] = !mobile && highlighted,
|
|
31
31
|
_b[styles__default.default.selected] = selected,
|
|
32
32
|
_b[styles__default.default.disabled] = disabled,
|
|
33
33
|
_b)), "data-test-id": dataTestId }),
|
|
@@ -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, 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, optionsListWidth = _a.optionsListWidth, nativeScrollbarProp = _a.nativeScrollbar,
|
|
31
|
+
var _c = _a.size, size = _c === void 0 ? 's' : _c, className = _a.className, optionGroupClassName = _a.optionGroupClassName, 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;
|
|
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)))); };
|
|
@@ -57,7 +57,7 @@ var OptionsList = React.forwardRef(function (_a, ref) {
|
|
|
57
57
|
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
58
|
header && React__default.default.createElement("div", { className: styles__default.default.optionsListHeader }, header),
|
|
59
59
|
nativeScrollbar ? renderWithNativeScrollbar() : renderWithCustomScrollbar(),
|
|
60
|
-
footer && (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.optionsListFooter, (_b = {},
|
|
60
|
+
showFooter && footer && (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.optionsListFooter, (_b = {},
|
|
61
61
|
_b[styles__default.default.withBorder] = visibleOptions && flatOptions.length > visibleOptions,
|
|
62
62
|
_b)) }, footer))));
|
|
63
63
|
});
|
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('tslib');
|
|
6
6
|
require('react');
|
|
7
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-
|
|
7
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-4727d474.js');
|
|
8
|
+
require('../../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
8
9
|
require('../arrow/Component.js');
|
|
9
10
|
require('../base-select-mobile/Component.js');
|
|
10
11
|
require('../base-select-mobile/footer/Component.js');
|
|
@@ -51,6 +52,7 @@ require('../../intersection-observer-9ec5cf59.js');
|
|
|
51
52
|
require('../../presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
52
53
|
require('@alfalab/core-components-button/cssm');
|
|
53
54
|
require('../../presets/useSelectWithApply/options-list-with-apply/footer/index.module.css');
|
|
55
|
+
require('../../presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
|
|
54
56
|
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
55
57
|
require('@alfalab/core-components-modal/cssm/mobile');
|
|
56
58
|
require('../base-select-mobile/index.module.css');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../Component-
|
|
1
|
+
export * from "../../Component-4727d474";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-
|
|
5
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-4727d474.js');
|
|
6
6
|
require('tslib');
|
|
7
7
|
require('react');
|
|
8
8
|
require('../../Component.js');
|
|
@@ -39,6 +39,8 @@ require('../options-list/Component.js');
|
|
|
39
39
|
require('@alfalab/core-components-scrollbar/cssm');
|
|
40
40
|
require('../../consts.js');
|
|
41
41
|
require('../options-list/index.module.css');
|
|
42
|
+
require('../../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
43
|
+
require('../../presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
|
|
42
44
|
require('../base-select-mobile/Component.js');
|
|
43
45
|
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
44
46
|
require('@alfalab/core-components-modal/cssm/mobile');
|
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('tslib');
|
|
6
6
|
require('react');
|
|
7
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-
|
|
7
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-4727d474.js');
|
|
8
|
+
require('../../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
8
9
|
require('../arrow/Component.js');
|
|
9
10
|
require('../base-select-mobile/Component.js');
|
|
10
11
|
require('../base-select-mobile/footer/Component.js');
|
|
@@ -51,6 +52,7 @@ require('../../intersection-observer-9ec5cf59.js');
|
|
|
51
52
|
require('../../presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
52
53
|
require('@alfalab/core-components-button/cssm');
|
|
53
54
|
require('../../presets/useSelectWithApply/options-list-with-apply/footer/index.module.css');
|
|
55
|
+
require('../../presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
|
|
54
56
|
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
55
57
|
require('@alfalab/core-components-modal/cssm/mobile');
|
|
56
58
|
require('../base-select-mobile/index.module.css');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../Component-
|
|
1
|
+
export * from "../../Component-4727d474";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-
|
|
5
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-4727d474.js');
|
|
6
6
|
require('tslib');
|
|
7
7
|
require('react');
|
|
8
8
|
require('../../Component.js');
|
|
@@ -39,6 +39,8 @@ require('../options-list/Component.js');
|
|
|
39
39
|
require('@alfalab/core-components-scrollbar/cssm');
|
|
40
40
|
require('../../consts.js');
|
|
41
41
|
require('../options-list/index.module.css');
|
|
42
|
+
require('../../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
43
|
+
require('../../presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
|
|
42
44
|
require('../base-select-mobile/Component.js');
|
|
43
45
|
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
44
46
|
require('@alfalab/core-components-modal/cssm/mobile');
|
|
@@ -24,11 +24,11 @@ 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, 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;
|
|
28
28
|
var listRef = React.useRef(null);
|
|
29
29
|
var parentRef = React.useRef(null);
|
|
30
30
|
var scrollbarRef = React.useRef(null);
|
|
31
|
-
var
|
|
31
|
+
var _k = React.useState(0), visibleOptionsInvalidateKey = _k[0], setVisibleOptionsInvalidateKey = _k[1];
|
|
32
32
|
var prevHighlightedIndex = utils.usePrevious(highlightedIndex) || -1;
|
|
33
33
|
var nativeScrollbar = hooks.useMedia([[true, '(max-width: 1023px)']], false)[0];
|
|
34
34
|
var rowVirtualizer = reactVirtual.useVirtual({
|
|
@@ -132,7 +132,7 @@ var VirtualOptionsList = React.forwardRef(function (_a, ref) {
|
|
|
132
132
|
header && React__default.default.createElement("div", { className: styles__default.default.virtualOptionsListHeader }, header),
|
|
133
133
|
nativeScrollbar ? renderWithNativeScrollbar() : renderWithCustomScrollbar(),
|
|
134
134
|
emptyPlaceholder && options.length === 0 && (React__default.default.createElement("div", { className: styles__default.default.emptyPlaceholder }, emptyPlaceholder)),
|
|
135
|
-
footer && (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.virtualOptionsListFooter, (_b = {},
|
|
135
|
+
showFooter && footer && (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.virtualOptionsListFooter, (_b = {},
|
|
136
136
|
_b[styles__default.default.withBorder] = visibleOptions && flatOptions.length > visibleOptions,
|
|
137
137
|
_b)) }, footer))));
|
|
138
138
|
});
|
|
@@ -29,17 +29,22 @@ type UseSelectWithApplyProps = {
|
|
|
29
29
|
* Показывать пункт "Выбрать все"
|
|
30
30
|
*/
|
|
31
31
|
showSelectAll?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Показывать пункт "Выбрать все" в заголовке списка
|
|
34
|
+
*/
|
|
35
|
+
showHeaderWithSelectAll?: boolean;
|
|
32
36
|
};
|
|
33
37
|
declare const SELECT_ALL_KEY = "select_all";
|
|
34
|
-
declare function useSelectWithApply({ options, selected, onChange, OptionsList, optionsListProps, showClear, showSelectAll, }: UseSelectWithApplyProps): {
|
|
38
|
+
declare function useSelectWithApply({ options, selected, onChange, OptionsList, optionsListProps, showClear, showSelectAll, showHeaderWithSelectAll, }: UseSelectWithApplyProps): {
|
|
35
39
|
OptionsList: import("react").ForwardRefExoticComponent<import("./index").OptionsListProps & {
|
|
36
40
|
showClear?: boolean | undefined;
|
|
37
41
|
onClose?: (() => void) | undefined;
|
|
38
42
|
selectedDraft?: OptionShape[] | undefined;
|
|
39
|
-
OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
|
|
40
|
-
* Пропсы, которые будут прокинуты в компонент списка
|
|
41
|
-
*/
|
|
43
|
+
OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
|
|
42
44
|
Footer?: import("react").FC<import("./presets/useSelectWithApply/options-list-with-apply/footer/Component").FooterProps> | undefined;
|
|
45
|
+
Header?: import("react").FC<import("./presets/useSelectWithApply/options-list-with-apply/header/Component").HeaderProps> | undefined;
|
|
46
|
+
headerProps?: import("./presets/useSelectWithApply/options-list-with-apply/header/Component").HeaderProps | undefined;
|
|
47
|
+
showHeaderWithSelectAll?: boolean | undefined;
|
|
43
48
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
44
49
|
optionsListProps: {
|
|
45
50
|
OptionsList: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
|
|
@@ -48,6 +53,12 @@ declare function useSelectWithApply({ options, selected, onChange, OptionsList,
|
|
|
48
53
|
onApply: () => void;
|
|
49
54
|
onClose: () => void;
|
|
50
55
|
selectedDraft: OptionShape[];
|
|
56
|
+
showHeaderWithSelectAll: boolean;
|
|
57
|
+
headerProps: {
|
|
58
|
+
indeterminate: boolean;
|
|
59
|
+
checked: boolean;
|
|
60
|
+
onChange: () => void;
|
|
61
|
+
};
|
|
51
62
|
};
|
|
52
63
|
allowUnselect: boolean;
|
|
53
64
|
multiple: boolean;
|
package/cssm/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var Component = require('./Component.js');
|
|
6
6
|
var components_arrow_Component = require('./components/arrow/Component.js');
|
|
7
7
|
var components_baseSelect_Component = require('./components/base-select/Component.js');
|
|
8
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-
|
|
8
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-4727d474.js');
|
|
9
9
|
var components_field_Component = require('./components/field/Component.js');
|
|
10
10
|
var components_optgroup_Component = require('./components/optgroup/Component.js');
|
|
11
11
|
var components_option_Component = require('./components/option/Component.js');
|
|
@@ -28,6 +28,9 @@ require('@alfalab/hooks');
|
|
|
28
28
|
require('./getDataTestId-5c876d98.js');
|
|
29
29
|
require('./components/native-select/Component.js');
|
|
30
30
|
require('./components/base-select/index.module.css');
|
|
31
|
+
require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
32
|
+
require('@alfalab/core-components-checkbox/cssm');
|
|
33
|
+
require('./presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
|
|
31
34
|
require('./components/base-select-mobile/Component.js');
|
|
32
35
|
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
33
36
|
require('@alfalab/core-components-modal/cssm/mobile');
|
|
@@ -40,7 +43,6 @@ require('@alfalab/core-components-form-control/cssm');
|
|
|
40
43
|
require('./components/field/index.module.css');
|
|
41
44
|
require('./components/optgroup/index.module.css');
|
|
42
45
|
require('@alfalab/core-components-badge/cssm');
|
|
43
|
-
require('@alfalab/core-components-checkbox/cssm');
|
|
44
46
|
require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
|
|
45
47
|
require('@alfalab/icons-glyph/CheckmarkMIcon');
|
|
46
48
|
require('./components/checkmark/index.module.css');
|
package/cssm/mobile.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { SelectMobile } from "./components/select-mobile/index";
|
|
2
|
+
export { SelectModalMobile } from "./components/select-modal-mobile/index";
|
|
3
|
+
export type { SelectMobileProps } from "./components/select-mobile/index";
|
|
4
|
+
export type { SelectModalMobileProps } from "./components/select-modal-mobile/index";
|
package/cssm/mobile.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-4727d474.js');
|
|
6
|
+
require('tslib');
|
|
7
|
+
require('react');
|
|
8
|
+
require('./Component.js');
|
|
9
|
+
require('./components/arrow/Component.js');
|
|
10
|
+
require('classnames');
|
|
11
|
+
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
12
|
+
require('./components/arrow/index.module.css');
|
|
13
|
+
require('./components/base-select/Component.js');
|
|
14
|
+
require('react-merge-refs');
|
|
15
|
+
require('@juggle/resize-observer');
|
|
16
|
+
require('downshift');
|
|
17
|
+
require('@alfalab/core-components-popover/cssm');
|
|
18
|
+
require('@alfalab/hooks');
|
|
19
|
+
require('./getDataTestId-5c876d98.js');
|
|
20
|
+
require('./utils.js');
|
|
21
|
+
require('./components/native-select/Component.js');
|
|
22
|
+
require('./components/base-select/index.module.css');
|
|
23
|
+
require('./components/field/Component.js');
|
|
24
|
+
require('@alfalab/core-components-form-control/cssm');
|
|
25
|
+
require('./components/field/index.module.css');
|
|
26
|
+
require('./components/optgroup/Component.js');
|
|
27
|
+
require('./components/optgroup/index.module.css');
|
|
28
|
+
require('./components/option/Component.js');
|
|
29
|
+
require('./components/checkmark/Component.js');
|
|
30
|
+
require('@alfalab/core-components-badge/cssm');
|
|
31
|
+
require('@alfalab/core-components-checkbox/cssm');
|
|
32
|
+
require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
|
|
33
|
+
require('@alfalab/icons-glyph/CheckmarkMIcon');
|
|
34
|
+
require('./components/checkmark/index.module.css');
|
|
35
|
+
require('./components/checkmark-mobile/Component.js');
|
|
36
|
+
require('./components/checkmark-mobile/index.module.css');
|
|
37
|
+
require('./components/option/index.module.css');
|
|
38
|
+
require('./components/options-list/Component.js');
|
|
39
|
+
require('@alfalab/core-components-scrollbar/cssm');
|
|
40
|
+
require('./consts.js');
|
|
41
|
+
require('./components/options-list/index.module.css');
|
|
42
|
+
require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
43
|
+
require('./presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
|
|
44
|
+
require('./components/base-select-mobile/Component.js');
|
|
45
|
+
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
46
|
+
require('@alfalab/core-components-modal/cssm/mobile');
|
|
47
|
+
require('./components/base-select-mobile/index.module.css');
|
|
48
|
+
require('./components/base-select-mobile/footer/Component.js');
|
|
49
|
+
require('@alfalab/core-components-base-modal/cssm');
|
|
50
|
+
require('@alfalab/core-components-button/cssm');
|
|
51
|
+
require('./components/base-select-mobile/footer/index.module.css');
|
|
52
|
+
require('./components/virtual-options-list/Component.js');
|
|
53
|
+
require('react-virtual');
|
|
54
|
+
require('./components/virtual-options-list/index.module.css');
|
|
55
|
+
require('./components/base-checkmark/index.module.css');
|
|
56
|
+
require('./components/base-option/index.module.css');
|
|
57
|
+
require('@alfalab/core-components-skeleton/cssm');
|
|
58
|
+
require('./presets/useSelectWithLoading/index.module.css');
|
|
59
|
+
require('./presets/useLazyLoading/index.module.css');
|
|
60
|
+
require('./intersection-observer-9ec5cf59.js');
|
|
61
|
+
require('./presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
62
|
+
require('./presets/useSelectWithApply/options-list-with-apply/footer/index.module.css');
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
exports.SelectMobile = presets_useSelectWithApply_optionsListWithApply_Component.SelectMobile;
|
|
67
|
+
exports.SelectModalMobile = presets_useSelectWithApply_optionsListWithApply_Component.SelectModalMobile;
|
package/cssm/presets/index.d.ts
CHANGED
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('../Component-
|
|
7
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../Component-4727d474.js');
|
|
8
8
|
require('tslib');
|
|
9
9
|
require('react');
|
|
10
10
|
require('@alfalab/core-components-skeleton/cssm');
|
|
@@ -45,6 +45,8 @@ require('../components/options-list/Component.js');
|
|
|
45
45
|
require('@alfalab/core-components-scrollbar/cssm');
|
|
46
46
|
require('../consts.js');
|
|
47
47
|
require('../components/options-list/index.module.css');
|
|
48
|
+
require('./useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
49
|
+
require('./useSelectWithApply/options-list-with-apply/header/index.module.css');
|
|
48
50
|
require('../components/base-select-mobile/Component.js');
|
|
49
51
|
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
50
52
|
require('@alfalab/core-components-modal/cssm/mobile');
|
|
@@ -9,7 +9,7 @@ require('classnames');
|
|
|
9
9
|
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
10
10
|
require('../../components/arrow/index.module.css');
|
|
11
11
|
require('../../components/base-select/Component.js');
|
|
12
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-
|
|
12
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-4727d474.js');
|
|
13
13
|
require('@alfalab/core-components-form-control/cssm');
|
|
14
14
|
require('@alfalab/hooks');
|
|
15
15
|
require('../../utils.js');
|
|
@@ -46,6 +46,8 @@ require('../../components/base-select/index.module.css');
|
|
|
46
46
|
require('@alfalab/core-components-scrollbar/cssm');
|
|
47
47
|
require('../../consts.js');
|
|
48
48
|
require('../../components/options-list/index.module.css');
|
|
49
|
+
require('./options-list-with-apply/header/Component.js');
|
|
50
|
+
require('./options-list-with-apply/header/index.module.css');
|
|
49
51
|
require('../../components/base-select-mobile/Component.js');
|
|
50
52
|
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
51
53
|
require('@alfalab/core-components-modal/cssm/mobile');
|
|
@@ -6,8 +6,9 @@ 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('../../../Component-
|
|
9
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../../Component-4727d474.js');
|
|
10
10
|
require('./footer/Component.js');
|
|
11
|
+
require('./header/Component.js');
|
|
11
12
|
require('react-merge-refs');
|
|
12
13
|
require('classnames');
|
|
13
14
|
require('@alfalab/core-components-scrollbar/cssm');
|
|
@@ -58,6 +59,7 @@ require('../../useSelectWithLoading/index.module.css');
|
|
|
58
59
|
require('../../useLazyLoading/index.module.css');
|
|
59
60
|
require('../../../intersection-observer-9ec5cf59.js');
|
|
60
61
|
require('./footer/index.module.css');
|
|
62
|
+
require('./header/index.module.css');
|
|
61
63
|
|
|
62
64
|
|
|
63
65
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CheckboxProps } from "@alfalab/core-components-checkbox";
|
|
4
|
+
type HeaderProps = {
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
indeterminate?: boolean;
|
|
7
|
+
onChange?: CheckboxProps['onChange'];
|
|
8
|
+
mobile?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const Header: React.FC<HeaderProps>;
|
|
11
|
+
export { HeaderProps, Header };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var cn = require('classnames');
|
|
7
|
+
var coreComponentsCheckbox = require('@alfalab/core-components-checkbox/cssm');
|
|
8
|
+
var styles = require('./index.module.css');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
|
+
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
13
|
+
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
14
|
+
var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
15
|
+
|
|
16
|
+
var Header = function (_a) {
|
|
17
|
+
var _b;
|
|
18
|
+
var onChange = _a.onChange, checked = _a.checked, indeterminate = _a.indeterminate, mobile = _a.mobile;
|
|
19
|
+
return (React__default.default.createElement("div", { className: cn__default.default((_b = {}, _b[styles__default.default.desktop] = !mobile, _b[styles__default.default.mobile] = mobile, _b)) },
|
|
20
|
+
React__default.default.createElement(coreComponentsCheckbox.Checkbox, { block: true, indeterminate: indeterminate, size: 'm', onChange: onChange, checked: checked, label: '\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435' })));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.Header = Header;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
} /* 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 */
|
|
3
|
+
} :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 */
|
|
4
|
+
} :root {
|
|
5
|
+
} :root {
|
|
6
|
+
|
|
7
|
+
/* Hard */
|
|
8
|
+
|
|
9
|
+
/* Up */
|
|
10
|
+
|
|
11
|
+
/* Hard up */
|
|
12
|
+
} :root {
|
|
13
|
+
} :root {
|
|
14
|
+
--gap-xs: 8px;
|
|
15
|
+
--gap-s: 12px;
|
|
16
|
+
} :root {
|
|
17
|
+
} :root {
|
|
18
|
+
} .desktop {
|
|
19
|
+
padding: var(--gap-s);
|
|
20
|
+
} .mobile {
|
|
21
|
+
padding: var(--gap-s) var(--gap-xs);
|
|
22
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../../Component-
|
|
1
|
+
export * from "../../../Component-4727d474";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../../Component-
|
|
5
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../../Component-4727d474.js');
|
|
6
6
|
require('tslib');
|
|
7
7
|
require('react');
|
|
8
8
|
require('../../../Component.js');
|
|
@@ -39,6 +39,8 @@ require('../../../components/options-list/Component.js');
|
|
|
39
39
|
require('@alfalab/core-components-scrollbar/cssm');
|
|
40
40
|
require('../../../consts.js');
|
|
41
41
|
require('../../../components/options-list/index.module.css');
|
|
42
|
+
require('./header/Component.js');
|
|
43
|
+
require('./header/index.module.css');
|
|
42
44
|
require('../../../components/base-select-mobile/Component.js');
|
|
43
45
|
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
44
46
|
require('@alfalab/core-components-modal/cssm/mobile');
|
package/cssm/responsive.js
CHANGED
|
@@ -39,7 +39,9 @@ require('./components/options-list/Component.js');
|
|
|
39
39
|
require('@alfalab/core-components-scrollbar/cssm');
|
|
40
40
|
require('./consts.js');
|
|
41
41
|
require('./components/options-list/index.module.css');
|
|
42
|
-
require('./Component-
|
|
42
|
+
require('./Component-4727d474.js');
|
|
43
|
+
require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
44
|
+
require('./presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
|
|
43
45
|
require('./components/base-select-mobile/Component.js');
|
|
44
46
|
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
45
47
|
require('@alfalab/core-components-modal/cssm/mobile');
|