@alfalab/core-components-select 10.3.0 → 10.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/dist/Component.d.ts +1 -1
- package/dist/Component.js +1 -1
- package/dist/components/arrow/Component.js +1 -1
- package/dist/components/arrow/index.css +3 -3
- package/dist/components/base-select/Component.js +24 -23
- package/dist/components/base-select/index.css +7 -7
- package/dist/components/base-select/index.js +1 -1
- package/dist/components/checkmark/Component.js +2 -2
- package/dist/components/checkmark/index.css +7 -7
- package/dist/components/field/Component.d.ts +1 -1
- package/dist/components/field/Component.js +3 -3
- package/dist/components/field/index.css +9 -9
- package/dist/components/field/index.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/native-select/Component.js +1 -1
- package/dist/components/native-select/index.js +1 -1
- package/dist/components/optgroup/Component.js +1 -1
- package/dist/components/optgroup/index.css +6 -6
- package/dist/components/option/Component.js +2 -2
- package/dist/components/option/index.css +20 -20
- package/dist/components/option/index.js +1 -1
- package/dist/components/options-list/Component.js +13 -8
- package/dist/components/options-list/index.css +9 -5
- package/dist/components/options-list/index.js +1 -0
- package/dist/components/virtual-options-list/Component.d.ts +1 -1
- package/dist/components/virtual-options-list/Component.js +22 -18
- package/dist/components/virtual-options-list/index.css +15 -12
- package/dist/components/virtual-options-list/index.js +1 -0
- package/dist/cssm/Component.d.ts +1 -1
- package/dist/cssm/components/base-select/Component.js +22 -21
- package/dist/cssm/components/checkmark/Component.js +1 -1
- package/dist/cssm/components/field/Component.d.ts +1 -1
- package/dist/cssm/components/field/Component.js +1 -1
- package/dist/cssm/components/options-list/Component.js +12 -7
- package/dist/cssm/components/options-list/index.js +1 -0
- package/dist/cssm/components/options-list/index.module.css +4 -0
- package/dist/cssm/components/virtual-options-list/Component.d.ts +1 -1
- package/dist/cssm/components/virtual-options-list/Component.js +21 -17
- package/dist/cssm/components/virtual-options-list/index.js +1 -0
- package/dist/cssm/components/virtual-options-list/index.module.css +4 -1
- package/dist/cssm/hook-3b9bd559.d.ts +12 -0
- package/dist/cssm/hook-3b9bd559.js +147 -0
- package/dist/cssm/hook-f5b8fe4f.d.ts +61 -0
- package/dist/cssm/index.js +7 -1
- package/dist/cssm/intersection-observer-8c55e13a.d.ts +1 -0
- package/dist/cssm/intersection-observer-8c55e13a.js +893 -0
- package/dist/cssm/presets/index.d.ts +1 -0
- package/dist/cssm/presets/index.js +29 -1
- package/dist/cssm/presets/useLazyLoading/hook.js +1 -892
- package/dist/cssm/presets/useSelectWithApply/hook.d.ts +0 -0
- package/dist/cssm/presets/useSelectWithApply/hook.js +46 -0
- package/dist/cssm/presets/useSelectWithApply/options-list-with-apply/Component.d.ts +0 -0
- package/dist/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +45 -0
- package/dist/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -0
- package/dist/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +45 -0
- package/dist/cssm/presets/useSelectWithApply/options-list-with-apply/index.module.css +38 -0
- package/dist/cssm/typings.d.ts +39 -6
- package/dist/esm/Component.d.ts +1 -1
- package/dist/esm/Component.js +1 -1
- package/dist/esm/components/arrow/Component.js +1 -1
- package/dist/esm/components/arrow/index.css +3 -3
- package/dist/esm/components/base-select/Component.js +24 -23
- package/dist/esm/components/base-select/index.css +7 -7
- package/dist/esm/components/base-select/index.js +1 -1
- package/dist/esm/components/checkmark/Component.js +2 -2
- package/dist/esm/components/checkmark/index.css +7 -7
- package/dist/esm/components/field/Component.d.ts +1 -1
- package/dist/esm/components/field/Component.js +3 -3
- package/dist/esm/components/field/index.css +9 -9
- package/dist/esm/components/field/index.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/native-select/Component.js +1 -1
- package/dist/esm/components/native-select/index.js +1 -1
- package/dist/esm/components/optgroup/Component.js +1 -1
- package/dist/esm/components/optgroup/index.css +6 -6
- package/dist/esm/components/option/Component.js +2 -2
- package/dist/esm/components/option/index.css +20 -20
- package/dist/esm/components/option/index.js +1 -1
- package/dist/esm/components/options-list/Component.js +14 -9
- package/dist/esm/components/options-list/index.css +9 -5
- package/dist/esm/components/options-list/index.js +1 -0
- package/dist/esm/components/virtual-options-list/Component.d.ts +1 -1
- package/dist/esm/components/virtual-options-list/Component.js +22 -18
- package/dist/esm/components/virtual-options-list/index.css +15 -12
- package/dist/esm/components/virtual-options-list/index.js +1 -0
- package/dist/esm/hook-ad760b61.d.ts +12 -0
- package/dist/esm/hook-ad760b61.js +131 -0
- package/dist/esm/hook-f5b8fe4f.d.ts +61 -0
- package/dist/esm/index.js +4 -1
- package/dist/esm/intersection-observer-e5cee21e.d.ts +1 -0
- package/dist/esm/intersection-observer-e5cee21e.js +891 -0
- package/dist/esm/presets/index.d.ts +1 -0
- package/dist/esm/presets/index.js +20 -1
- package/dist/esm/presets/useLazyLoading/hook.js +3 -894
- package/dist/esm/presets/useLazyLoading/index.css +2 -2
- package/dist/esm/presets/useSelectWithApply/hook.d.ts +0 -0
- package/dist/esm/presets/useSelectWithApply/hook.js +26 -0
- package/dist/esm/presets/useSelectWithApply/options-list-with-apply/Component.d.ts +0 -0
- package/dist/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +26 -0
- package/dist/esm/presets/useSelectWithApply/options-list-with-apply/index.css +39 -0
- package/dist/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -0
- package/dist/esm/presets/useSelectWithApply/options-list-with-apply/index.js +26 -0
- package/dist/esm/presets/useSelectWithLoading/hook.js +2 -2
- package/dist/esm/presets/useSelectWithLoading/index.css +2 -2
- package/dist/esm/{tslib.es6-5a8a0ede.d.ts → tslib.es6-877b9695.d.ts} +0 -0
- package/dist/esm/{tslib.es6-5a8a0ede.js → tslib.es6-877b9695.js} +0 -0
- package/dist/esm/typings.d.ts +39 -6
- package/dist/hook-b5dec5da.d.ts +12 -0
- package/dist/hook-b5dec5da.js +140 -0
- package/dist/hook-f5b8fe4f.d.ts +61 -0
- package/dist/index.js +6 -1
- package/dist/intersection-observer-cb877b82.d.ts +1 -0
- package/dist/intersection-observer-cb877b82.js +893 -0
- package/dist/modern/Component.d.ts +1 -1
- package/dist/modern/components/arrow/Component.js +1 -1
- package/dist/modern/components/arrow/index.css +3 -3
- package/dist/modern/components/base-select/Component.js +18 -15
- package/dist/modern/components/base-select/index.css +7 -7
- package/dist/modern/components/checkmark/Component.js +2 -2
- package/dist/modern/components/checkmark/index.css +7 -7
- package/dist/modern/components/field/Component.d.ts +1 -1
- package/dist/modern/components/field/Component.js +2 -2
- package/dist/modern/components/field/index.css +9 -9
- package/dist/modern/components/optgroup/Component.js +1 -1
- package/dist/modern/components/optgroup/index.css +6 -6
- package/dist/modern/components/option/Component.js +1 -1
- package/dist/modern/components/option/index.css +20 -20
- package/dist/modern/components/options-list/Component.js +11 -7
- package/dist/modern/components/options-list/index.css +9 -5
- package/dist/modern/components/virtual-options-list/Component.d.ts +1 -1
- package/dist/modern/components/virtual-options-list/Component.js +20 -17
- package/dist/modern/components/virtual-options-list/index.css +15 -12
- package/dist/modern/hook-2c7fd2b8.d.ts +12 -0
- package/dist/modern/hook-2c7fd2b8.js +132 -0
- package/dist/modern/hook-f5b8fe4f.d.ts +61 -0
- package/dist/modern/index.js +3 -0
- package/dist/modern/intersection-observer-e5cee21e.d.ts +1 -0
- package/dist/modern/intersection-observer-e5cee21e.js +891 -0
- package/dist/modern/presets/index.d.ts +1 -0
- package/dist/modern/presets/index.js +19 -0
- package/dist/modern/presets/useLazyLoading/hook.js +2 -893
- package/dist/modern/presets/useLazyLoading/index.css +2 -2
- package/dist/modern/presets/useSelectWithApply/hook.d.ts +0 -0
- package/dist/modern/presets/useSelectWithApply/hook.js +25 -0
- package/dist/modern/presets/useSelectWithApply/options-list-with-apply/Component.d.ts +0 -0
- package/dist/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +25 -0
- package/dist/modern/presets/useSelectWithApply/options-list-with-apply/index.css +39 -0
- package/dist/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -0
- package/dist/modern/presets/useSelectWithApply/options-list-with-apply/index.js +25 -0
- package/dist/modern/presets/useSelectWithLoading/hook.js +1 -1
- package/dist/modern/presets/useSelectWithLoading/index.css +2 -2
- package/dist/modern/typings.d.ts +39 -6
- package/dist/presets/index.d.ts +1 -0
- package/dist/presets/index.js +22 -1
- package/dist/presets/useLazyLoading/hook.js +3 -894
- package/dist/presets/useLazyLoading/index.css +2 -2
- package/dist/presets/useSelectWithApply/hook.d.ts +0 -0
- package/dist/presets/useSelectWithApply/hook.js +35 -0
- package/dist/presets/useSelectWithApply/options-list-with-apply/Component.d.ts +0 -0
- package/dist/presets/useSelectWithApply/options-list-with-apply/Component.js +34 -0
- package/dist/presets/useSelectWithApply/options-list-with-apply/index.css +39 -0
- package/dist/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -0
- package/dist/presets/useSelectWithApply/options-list-with-apply/index.js +34 -0
- package/dist/presets/useSelectWithLoading/hook.js +2 -2
- package/dist/presets/useSelectWithLoading/index.css +2 -2
- package/dist/{tslib.es6-f6070e97.d.ts → tslib.es6-4db16fbd.d.ts} +0 -0
- package/dist/{tslib.es6-f6070e97.js → tslib.es6-4db16fbd.js} +0 -0
- package/dist/typings.d.ts +39 -6
- package/package.json +4 -3
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { OptionShape, BaseSelectProps } from "./index";
|
|
3
|
+
type useSelectWithApplyProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Список выбранных пунктов
|
|
6
|
+
*/
|
|
7
|
+
selected: BaseSelectProps['selected'];
|
|
8
|
+
/**
|
|
9
|
+
* Список вариантов выбора
|
|
10
|
+
*/
|
|
11
|
+
options: BaseSelectProps['options'];
|
|
12
|
+
/**
|
|
13
|
+
* Обработчик выбора
|
|
14
|
+
*/
|
|
15
|
+
onChange: BaseSelectProps['onChange'];
|
|
16
|
+
/**
|
|
17
|
+
* Компонент выпадающего меню
|
|
18
|
+
*/
|
|
19
|
+
OptionsList?: BaseSelectProps['OptionsList'];
|
|
20
|
+
/**
|
|
21
|
+
* Показывать кнопку очистки
|
|
22
|
+
*/
|
|
23
|
+
showClear?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Показывать пункт "Выбрать все"
|
|
26
|
+
*/
|
|
27
|
+
showSelectAll?: boolean;
|
|
28
|
+
};
|
|
29
|
+
declare const SELECT_ALL_KEY = "select_all";
|
|
30
|
+
declare function useSelectWithApply({ options, selected, onChange, OptionsList, showClear, showSelectAll, }: useSelectWithApplyProps): {
|
|
31
|
+
OptionsList: import("react").ForwardRefExoticComponent<import("./index").OptionsListProps & {
|
|
32
|
+
showClear?: boolean | undefined;
|
|
33
|
+
onApply?: (() => void) | undefined;
|
|
34
|
+
onClear?: (() => void) | undefined;
|
|
35
|
+
onClose?: (() => void) | undefined;
|
|
36
|
+
selectedDraft?: OptionShape[] | undefined;
|
|
37
|
+
OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<unknown>> | undefined;
|
|
38
|
+
} & import("react").RefAttributes<unknown>>;
|
|
39
|
+
optionsListProps: {
|
|
40
|
+
OptionsList: import("react").FC<import("./index").OptionsListProps> | undefined;
|
|
41
|
+
showClear: boolean;
|
|
42
|
+
onClear: () => void;
|
|
43
|
+
onApply: () => void;
|
|
44
|
+
onClose: () => void;
|
|
45
|
+
selectedDraft: OptionShape[];
|
|
46
|
+
};
|
|
47
|
+
allowUnselect: boolean;
|
|
48
|
+
multiple: boolean;
|
|
49
|
+
options: (OptionShape | import("./index").GroupShape | {
|
|
50
|
+
key: string;
|
|
51
|
+
content: string;
|
|
52
|
+
})[];
|
|
53
|
+
onChange: (payload: {
|
|
54
|
+
selected: OptionShape | null;
|
|
55
|
+
selectedMultiple: OptionShape[];
|
|
56
|
+
initiator: OptionShape | null;
|
|
57
|
+
name?: string | undefined;
|
|
58
|
+
}) => void;
|
|
59
|
+
selected: string | OptionShape | (string | OptionShape)[] | null | undefined;
|
|
60
|
+
};
|
|
61
|
+
export { SELECT_ALL_KEY, useSelectWithApply };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './tslib.es6-
|
|
1
|
+
import './tslib.es6-877b9695.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import '@alfalab/hooks';
|
|
@@ -23,4 +23,7 @@ import 'react-virtual';
|
|
|
23
23
|
export { VirtualOptionsList } from './components/virtual-options-list/Component.js';
|
|
24
24
|
import '@alfalab/core-components-skeleton/dist/esm';
|
|
25
25
|
export { useSelectWithLoading } from './presets/useSelectWithLoading/hook.js';
|
|
26
|
+
import './intersection-observer-e5cee21e.js';
|
|
26
27
|
export { useLazyLoading } from './presets/useLazyLoading/hook.js';
|
|
28
|
+
import '@alfalab/core-components-button/dist/esm';
|
|
29
|
+
export { S as SELECT_ALL_KEY, u as useSelectWithApply } from './hook-ad760b61.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|