@alfalab/core-components-custom-picker-button 1.0.1 → 1.0.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.
@@ -1,142 +1,12 @@
1
- /// <reference types="react-transition-group" />
2
1
  /// <reference types="react" />
2
+ /// <reference types="react-transition-group" />
3
3
  import React from 'react';
4
- import { FC, KeyboardEvent, MouseEvent, MutableRefObject, ReactNode, Ref } from "react";
5
- import { TransitionProps } from 'react-transition-group/Transition';
6
- import { BackdropProps, PortalProps } from "./index-ebda875c";
7
- type BaseModalProps = {
8
- /**
9
- * Контент
10
- */
11
- children?: ReactNode;
12
- /**
13
- * Компонент бэкдропа
14
- */
15
- Backdrop?: FC<BackdropProps>;
16
- /**
17
- * Свойства для Бэкдропа
18
- */
19
- backdropProps?: Partial<BackdropProps> & Record<string, unknown>;
20
- /**
21
- * Нода, компонент или функция возвращающая их
22
- *
23
- * Контейнер к которому будут добавляться порталы
24
- */
25
- container?: PortalProps['getPortalContainer'];
26
- /**
27
- * Отключает автоматический перевод фокуса на модалку при открытии
28
- * @default false
29
- */
30
- disableAutoFocus?: boolean;
31
- /**
32
- * Отключает ловушку фокуса
33
- * @default false
34
- */
35
- disableFocusLock?: boolean;
36
- /**
37
- * Отключает восстановление фокуса на предыдущем элементе после закрытия модалки
38
- * @default false
39
- */
40
- disableRestoreFocus?: boolean;
41
- /**
42
- * Отключает вызов `callback` при нажатии Escape
43
- * @default false
44
- */
45
- disableEscapeKeyDown?: boolean;
46
- /**
47
- * Отключает вызов `callback` при клике на бэкдроп
48
- * @default false
49
- */
50
- disableBackdropClick?: boolean;
51
- /**
52
- * Отключает блокировку скролла при открытии модального окна
53
- * @default false
54
- */
55
- disableBlockingScroll?: boolean;
56
- /**
57
- * Содержимое модалки всегда в DOM
58
- * @default false
59
- */
60
- keepMounted?: boolean;
61
- /**
62
- * Управление видимостью модалки
63
- */
64
- open: boolean;
65
- /**
66
- * Дополнительный класс
67
- */
68
- className?: string;
69
- /**
70
- * Дополнительный класс
71
- */
72
- contentClassName?: string;
73
- /**
74
- * Дополнительный класс для обертки (Modal)
75
- */
76
- wrapperClassName?: string;
77
- /**
78
- * Обработчик скролла контента
79
- */
80
- scrollHandler?: 'wrapper' | 'content' | MutableRefObject<HTMLDivElement | null>;
81
- /**
82
- * Пропсы для анимации (CSSTransition)
83
- */
84
- transitionProps?: Partial<TransitionProps>;
85
- /**
86
- * Рендерить ли в контейнер через портал.
87
- * @default true
88
- */
89
- usePortal?: boolean;
90
- /**
91
- * Обработчик события нажатия на бэкдроп
92
- */
93
- onBackdropClick?: (event: MouseEvent) => void;
94
- /**
95
- * Обработчик события нажатия на Escape
96
- *
97
- * Если `disableEscapeKeyDown` - false и модальное окно в фокусе
98
- */
99
- onEscapeKeyDown?: (event: KeyboardEvent) => void;
100
- /**
101
- * Обработчик закрытия
102
- */
103
- onClose?: (event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>, reason?: 'backdropClick' | 'escapeKeyDown' | 'closerClick') => void;
104
- /**
105
- * Обработчик события onEntered компонента Transition
106
- */
107
- onMount?: () => void;
108
- /**
109
- * Обработчик события onExited компонента Transition
110
- */
111
- onUnmount?: () => void;
112
- /**
113
- * Идентификатор для систем автоматизированного тестирования
114
- */
115
- dataTestId?: string;
116
- /**
117
- * z-index компонента
118
- */
119
- zIndex?: number;
120
- /**
121
- * Реф, который должен быть установлен компонентной области
122
- */
123
- componentRef?: MutableRefObject<HTMLDivElement | null>;
124
- };
125
- type BaseModalContext = {
126
- parentRef: React.RefObject<HTMLDivElement>;
127
- componentRef: React.RefObject<HTMLDivElement>;
128
- hasFooter?: boolean;
129
- hasHeader?: boolean;
130
- hasScroll?: boolean;
131
- headerHighlighted?: boolean;
132
- footerHighlighted?: boolean;
133
- headerOffset?: number;
134
- setHeaderOffset: (offset: number) => void;
135
- contentRef: Ref<HTMLElement>;
136
- setHasHeader: (exists: boolean) => void;
137
- setHasFooter: (exists: boolean) => void;
138
- onClose: Required<BaseModalProps>['onClose'];
4
+ import { CheckboxProps } from "./index-ebda875c";
5
+ type HeaderProps = {
6
+ checked?: boolean;
7
+ indeterminate?: boolean;
8
+ onChange?: CheckboxProps['onChange'];
9
+ mobile?: boolean;
139
10
  };
140
- declare const BaseModalContext: React.Context<BaseModalContext>;
141
- declare const BaseModal: React.ForwardRefExoticComponent<BaseModalProps & React.RefAttributes<HTMLDivElement>>;
142
- export { BaseModalProps, BaseModalContext, BaseModal };
11
+ declare const Header: React.FC<HeaderProps>;
12
+ export { HeaderProps, Header };
@@ -4,7 +4,7 @@ import { FC, RefObject, ReactNode } from "react";
4
4
  import { NavigationBarProps } from "./index-e81c389f";
5
5
  import { SwipeableHandlers } from "react-swipeable";
6
6
  import { BackdropProps } from "./index-ebda875c";
7
- import { BottomSheetProps } from "./types-5e678ff2";
7
+ import { BottomSheetProps } from "./types-fae20163";
8
8
  type HeaderProps = Omit<NavigationBarProps, "view" | "size"> & {
9
9
  headerRef: RefObject<HTMLDivElement>;
10
10
  };
@@ -1,142 +1,12 @@
1
- /// <reference types="react-transition-group" />
2
1
  /// <reference types="react" />
2
+ /// <reference types="react-transition-group" />
3
3
  import React from 'react';
4
- import { FC, KeyboardEvent, MouseEvent, MutableRefObject, ReactNode, Ref } from "react";
5
- import { TransitionProps } from 'react-transition-group/Transition';
6
- import { BackdropProps, PortalProps } from "./index-ebda875c";
7
- type BaseModalProps = {
8
- /**
9
- * Контент
10
- */
11
- children?: ReactNode;
12
- /**
13
- * Компонент бэкдропа
14
- */
15
- Backdrop?: FC<BackdropProps>;
16
- /**
17
- * Свойства для Бэкдропа
18
- */
19
- backdropProps?: Partial<BackdropProps> & Record<string, unknown>;
20
- /**
21
- * Нода, компонент или функция возвращающая их
22
- *
23
- * Контейнер к которому будут добавляться порталы
24
- */
25
- container?: PortalProps['getPortalContainer'];
26
- /**
27
- * Отключает автоматический перевод фокуса на модалку при открытии
28
- * @default false
29
- */
30
- disableAutoFocus?: boolean;
31
- /**
32
- * Отключает ловушку фокуса
33
- * @default false
34
- */
35
- disableFocusLock?: boolean;
36
- /**
37
- * Отключает восстановление фокуса на предыдущем элементе после закрытия модалки
38
- * @default false
39
- */
40
- disableRestoreFocus?: boolean;
41
- /**
42
- * Отключает вызов `callback` при нажатии Escape
43
- * @default false
44
- */
45
- disableEscapeKeyDown?: boolean;
46
- /**
47
- * Отключает вызов `callback` при клике на бэкдроп
48
- * @default false
49
- */
50
- disableBackdropClick?: boolean;
51
- /**
52
- * Отключает блокировку скролла при открытии модального окна
53
- * @default false
54
- */
55
- disableBlockingScroll?: boolean;
56
- /**
57
- * Содержимое модалки всегда в DOM
58
- * @default false
59
- */
60
- keepMounted?: boolean;
61
- /**
62
- * Управление видимостью модалки
63
- */
64
- open: boolean;
65
- /**
66
- * Дополнительный класс
67
- */
68
- className?: string;
69
- /**
70
- * Дополнительный класс
71
- */
72
- contentClassName?: string;
73
- /**
74
- * Дополнительный класс для обертки (Modal)
75
- */
76
- wrapperClassName?: string;
77
- /**
78
- * Обработчик скролла контента
79
- */
80
- scrollHandler?: 'wrapper' | 'content' | MutableRefObject<HTMLDivElement | null>;
81
- /**
82
- * Пропсы для анимации (CSSTransition)
83
- */
84
- transitionProps?: Partial<TransitionProps>;
85
- /**
86
- * Рендерить ли в контейнер через портал.
87
- * @default true
88
- */
89
- usePortal?: boolean;
90
- /**
91
- * Обработчик события нажатия на бэкдроп
92
- */
93
- onBackdropClick?: (event: MouseEvent) => void;
94
- /**
95
- * Обработчик события нажатия на Escape
96
- *
97
- * Если `disableEscapeKeyDown` - false и модальное окно в фокусе
98
- */
99
- onEscapeKeyDown?: (event: KeyboardEvent) => void;
100
- /**
101
- * Обработчик закрытия
102
- */
103
- onClose?: (event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>, reason?: 'backdropClick' | 'escapeKeyDown' | 'closerClick') => void;
104
- /**
105
- * Обработчик события onEntered компонента Transition
106
- */
107
- onMount?: () => void;
108
- /**
109
- * Обработчик события onExited компонента Transition
110
- */
111
- onUnmount?: () => void;
112
- /**
113
- * Идентификатор для систем автоматизированного тестирования
114
- */
115
- dataTestId?: string;
116
- /**
117
- * z-index компонента
118
- */
119
- zIndex?: number;
120
- /**
121
- * Реф, который должен быть установлен компонентной области
122
- */
123
- componentRef?: MutableRefObject<HTMLDivElement | null>;
124
- };
125
- type BaseModalContext = {
126
- parentRef: React.RefObject<HTMLDivElement>;
127
- componentRef: React.RefObject<HTMLDivElement>;
128
- hasFooter?: boolean;
129
- hasHeader?: boolean;
130
- hasScroll?: boolean;
131
- headerHighlighted?: boolean;
132
- footerHighlighted?: boolean;
133
- headerOffset?: number;
134
- setHeaderOffset: (offset: number) => void;
135
- contentRef: Ref<HTMLElement>;
136
- setHasHeader: (exists: boolean) => void;
137
- setHasFooter: (exists: boolean) => void;
138
- onClose: Required<BaseModalProps>['onClose'];
4
+ import { CheckboxProps } from "./index-ebda875c";
5
+ type HeaderProps = {
6
+ checked?: boolean;
7
+ indeterminate?: boolean;
8
+ onChange?: CheckboxProps['onChange'];
9
+ mobile?: boolean;
139
10
  };
140
- declare const BaseModalContext: React.Context<BaseModalContext>;
141
- declare const BaseModal: React.ForwardRefExoticComponent<BaseModalProps & React.RefAttributes<HTMLDivElement>>;
142
- export { BaseModalProps, BaseModalContext, BaseModal };
11
+ declare const Header: React.FC<HeaderProps>;
12
+ export { HeaderProps, Header };
@@ -4,7 +4,7 @@ import { FC, RefObject, ReactNode } from "react";
4
4
  import { NavigationBarProps } from "./index-e81c389f";
5
5
  import { SwipeableHandlers } from "react-swipeable";
6
6
  import { BackdropProps } from "./index-ebda875c";
7
- import { BottomSheetProps } from "./types-5e678ff2";
7
+ import { BottomSheetProps } from "./types-fae20163";
8
8
  type HeaderProps = Omit<NavigationBarProps, "view" | "size"> & {
9
9
  headerRef: RefObject<HTMLDivElement>;
10
10
  };
@@ -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-3e68f8db").OptionsListProps & {
36
40
  showClear?: boolean | undefined;
37
41
  onClose?: (() => void) | undefined;
38
42
  selectedDraft?: OptionShape[] | undefined;
39
- OptionsList?: import("react").FC<import("./index-3e68f8db").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined; /**
40
- * Пропсы, которые будут прокинуты в компонент списка
41
- */
43
+ OptionsList?: import("react").FC<import("./index-3e68f8db").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
42
44
  Footer?: import("react").FC<import("./Component-ebda875c").FooterProps> | undefined;
45
+ Header?: import("react").FC<import("./Component-ebda875c").HeaderProps> | undefined;
46
+ headerProps?: import("./Component-ebda875c").HeaderProps | undefined;
47
+ showHeaderWithSelectAll?: boolean | undefined;
43
48
  } & import("react").RefAttributes<HTMLDivElement>>;
44
49
  optionsListProps: {
45
50
  OptionsList: import("react").FC<import("./index-3e68f8db").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;
@@ -1,3 +1,3 @@
1
1
  export * from "./component-3885b0d7";
2
- export type { BottomSheetProps, BottomSheetTitleAlign } from "./types-5e678ff2";
2
+ export type { BottomSheetProps, BottomSheetTitleAlign } from "./types-fae20163";
3
3
  export { CLOSE_OFFSET, HEADER_OFFSET } from "./utils-b64479aa";
@@ -161,6 +161,10 @@ type BottomSheetProps = {
161
161
  * Отключает блокировку скролла при открытии модального окна
162
162
  */
163
163
  disableBlockingScroll?: boolean;
164
+ /**
165
+ * Отключает ловушку фокуса
166
+ */
167
+ disableFocusLock?: boolean;
164
168
  /**
165
169
  * @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
166
170
  * Не анимировать шторку при изменении размера вьюпорта
@@ -1,142 +1,12 @@
1
- /// <reference types="react-transition-group" />
2
1
  /// <reference types="react" />
2
+ /// <reference types="react-transition-group" />
3
3
  import React from 'react';
4
- import { FC, KeyboardEvent, MouseEvent, MutableRefObject, ReactNode, Ref } from "react";
5
- import { TransitionProps } from 'react-transition-group/Transition';
6
- import { BackdropProps, PortalProps } from "./index-ebda875c";
7
- type BaseModalProps = {
8
- /**
9
- * Контент
10
- */
11
- children?: ReactNode;
12
- /**
13
- * Компонент бэкдропа
14
- */
15
- Backdrop?: FC<BackdropProps>;
16
- /**
17
- * Свойства для Бэкдропа
18
- */
19
- backdropProps?: Partial<BackdropProps> & Record<string, unknown>;
20
- /**
21
- * Нода, компонент или функция возвращающая их
22
- *
23
- * Контейнер к которому будут добавляться порталы
24
- */
25
- container?: PortalProps['getPortalContainer'];
26
- /**
27
- * Отключает автоматический перевод фокуса на модалку при открытии
28
- * @default false
29
- */
30
- disableAutoFocus?: boolean;
31
- /**
32
- * Отключает ловушку фокуса
33
- * @default false
34
- */
35
- disableFocusLock?: boolean;
36
- /**
37
- * Отключает восстановление фокуса на предыдущем элементе после закрытия модалки
38
- * @default false
39
- */
40
- disableRestoreFocus?: boolean;
41
- /**
42
- * Отключает вызов `callback` при нажатии Escape
43
- * @default false
44
- */
45
- disableEscapeKeyDown?: boolean;
46
- /**
47
- * Отключает вызов `callback` при клике на бэкдроп
48
- * @default false
49
- */
50
- disableBackdropClick?: boolean;
51
- /**
52
- * Отключает блокировку скролла при открытии модального окна
53
- * @default false
54
- */
55
- disableBlockingScroll?: boolean;
56
- /**
57
- * Содержимое модалки всегда в DOM
58
- * @default false
59
- */
60
- keepMounted?: boolean;
61
- /**
62
- * Управление видимостью модалки
63
- */
64
- open: boolean;
65
- /**
66
- * Дополнительный класс
67
- */
68
- className?: string;
69
- /**
70
- * Дополнительный класс
71
- */
72
- contentClassName?: string;
73
- /**
74
- * Дополнительный класс для обертки (Modal)
75
- */
76
- wrapperClassName?: string;
77
- /**
78
- * Обработчик скролла контента
79
- */
80
- scrollHandler?: 'wrapper' | 'content' | MutableRefObject<HTMLDivElement | null>;
81
- /**
82
- * Пропсы для анимации (CSSTransition)
83
- */
84
- transitionProps?: Partial<TransitionProps>;
85
- /**
86
- * Рендерить ли в контейнер через портал.
87
- * @default true
88
- */
89
- usePortal?: boolean;
90
- /**
91
- * Обработчик события нажатия на бэкдроп
92
- */
93
- onBackdropClick?: (event: MouseEvent) => void;
94
- /**
95
- * Обработчик события нажатия на Escape
96
- *
97
- * Если `disableEscapeKeyDown` - false и модальное окно в фокусе
98
- */
99
- onEscapeKeyDown?: (event: KeyboardEvent) => void;
100
- /**
101
- * Обработчик закрытия
102
- */
103
- onClose?: (event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>, reason?: 'backdropClick' | 'escapeKeyDown' | 'closerClick') => void;
104
- /**
105
- * Обработчик события onEntered компонента Transition
106
- */
107
- onMount?: () => void;
108
- /**
109
- * Обработчик события onExited компонента Transition
110
- */
111
- onUnmount?: () => void;
112
- /**
113
- * Идентификатор для систем автоматизированного тестирования
114
- */
115
- dataTestId?: string;
116
- /**
117
- * z-index компонента
118
- */
119
- zIndex?: number;
120
- /**
121
- * Реф, который должен быть установлен компонентной области
122
- */
123
- componentRef?: MutableRefObject<HTMLDivElement | null>;
124
- };
125
- type BaseModalContext = {
126
- parentRef: React.RefObject<HTMLDivElement>;
127
- componentRef: React.RefObject<HTMLDivElement>;
128
- hasFooter?: boolean;
129
- hasHeader?: boolean;
130
- hasScroll?: boolean;
131
- headerHighlighted?: boolean;
132
- footerHighlighted?: boolean;
133
- headerOffset?: number;
134
- setHeaderOffset: (offset: number) => void;
135
- contentRef: Ref<HTMLElement>;
136
- setHasHeader: (exists: boolean) => void;
137
- setHasFooter: (exists: boolean) => void;
138
- onClose: Required<BaseModalProps>['onClose'];
4
+ import { CheckboxProps } from "./index-ebda875c";
5
+ type HeaderProps = {
6
+ checked?: boolean;
7
+ indeterminate?: boolean;
8
+ onChange?: CheckboxProps['onChange'];
9
+ mobile?: boolean;
139
10
  };
140
- declare const BaseModalContext: React.Context<BaseModalContext>;
141
- declare const BaseModal: React.ForwardRefExoticComponent<BaseModalProps & React.RefAttributes<HTMLDivElement>>;
142
- export { BaseModalProps, BaseModalContext, BaseModal };
11
+ declare const Header: React.FC<HeaderProps>;
12
+ export { HeaderProps, Header };
@@ -4,7 +4,7 @@ import { FC, RefObject, ReactNode } from "react";
4
4
  import { NavigationBarProps } from "./index-e81c389f";
5
5
  import { SwipeableHandlers } from "react-swipeable";
6
6
  import { BackdropProps } from "./index-ebda875c";
7
- import { BottomSheetProps } from "./types-5e678ff2";
7
+ import { BottomSheetProps } from "./types-fae20163";
8
8
  type HeaderProps = Omit<NavigationBarProps, "view" | "size"> & {
9
9
  headerRef: RefObject<HTMLDivElement>;
10
10
  };
@@ -4,7 +4,7 @@ import cn from 'classnames';
4
4
  import { CustomButton } from '@alfalab/core-components-custom-button/esm';
5
5
  import { getIcon } from '@alfalab/core-components-picker-button/esm';
6
6
 
7
- var styles = {"iconContainer":"custom-picker-button__iconContainer_1bejm","addonsContainer":"custom-picker-button__addonsContainer_1bejm","showControlIcon":"custom-picker-button__showControlIcon_1bejm","open":"custom-picker-button__open_1bejm"};
7
+ var styles = {"iconContainer":"custom-picker-button__iconContainer_zdnvq","addonsContainer":"custom-picker-button__addonsContainer_zdnvq","showControlIcon":"custom-picker-button__showControlIcon_zdnvq","open":"custom-picker-button__open_zdnvq"};
8
8
  require('./index.css')
9
9
 
10
10
  var Field = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 1e1al */
1
+ /* hash: 15ofi */
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 */
@@ -16,13 +16,13 @@
16
16
  } :root {
17
17
  } :root {
18
18
  --arrow-transform: rotate(180deg);
19
- } .custom-picker-button__iconContainer_1bejm {
19
+ } .custom-picker-button__iconContainer_zdnvq {
20
20
  display: flex;
21
21
  transition: transform 0.15s ease-in-out;
22
- } .custom-picker-button__addonsContainer_1bejm {
22
+ } .custom-picker-button__addonsContainer_zdnvq {
23
23
  display: flex
24
- } .custom-picker-button__addonsContainer_1bejm.custom-picker-button__showControlIcon_1bejm {
24
+ } .custom-picker-button__addonsContainer_zdnvq.custom-picker-button__showControlIcon_zdnvq {
25
25
  margin-right: var(--gap-2xs);
26
- } .custom-picker-button__open_1bejm {
26
+ } .custom-picker-button__open_zdnvq {
27
27
  transform: var(--arrow-transform);
28
28
  }
@@ -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-3e68f8db").OptionsListProps & {
36
40
  showClear?: boolean | undefined;
37
41
  onClose?: (() => void) | undefined;
38
42
  selectedDraft?: OptionShape[] | undefined;
39
- OptionsList?: import("react").FC<import("./index-3e68f8db").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined; /**
40
- * Пропсы, которые будут прокинуты в компонент списка
41
- */
43
+ OptionsList?: import("react").FC<import("./index-3e68f8db").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
42
44
  Footer?: import("react").FC<import("./Component-ebda875c").FooterProps> | undefined;
45
+ Header?: import("react").FC<import("./Component-ebda875c").HeaderProps> | undefined;
46
+ headerProps?: import("./Component-ebda875c").HeaderProps | undefined;
47
+ showHeaderWithSelectAll?: boolean | undefined;
43
48
  } & import("react").RefAttributes<HTMLDivElement>>;
44
49
  optionsListProps: {
45
50
  OptionsList: import("react").FC<import("./index-3e68f8db").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;
@@ -1,3 +1,3 @@
1
1
  export * from "./component-3885b0d7";
2
- export type { BottomSheetProps, BottomSheetTitleAlign } from "./types-5e678ff2";
2
+ export type { BottomSheetProps, BottomSheetTitleAlign } from "./types-fae20163";
3
3
  export { CLOSE_OFFSET, HEADER_OFFSET } from "./utils-b64479aa";
@@ -161,6 +161,10 @@ type BottomSheetProps = {
161
161
  * Отключает блокировку скролла при открытии модального окна
162
162
  */
163
163
  disableBlockingScroll?: boolean;
164
+ /**
165
+ * Отключает ловушку фокуса
166
+ */
167
+ disableFocusLock?: boolean;
164
168
  /**
165
169
  * @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
166
170
  * Не анимировать шторку при изменении размера вьюпорта
@@ -13,7 +13,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
13
13
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
14
14
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
15
15
 
16
- var styles = {"iconContainer":"custom-picker-button__iconContainer_1bejm","addonsContainer":"custom-picker-button__addonsContainer_1bejm","showControlIcon":"custom-picker-button__showControlIcon_1bejm","open":"custom-picker-button__open_1bejm"};
16
+ var styles = {"iconContainer":"custom-picker-button__iconContainer_zdnvq","addonsContainer":"custom-picker-button__addonsContainer_zdnvq","showControlIcon":"custom-picker-button__showControlIcon_zdnvq","open":"custom-picker-button__open_zdnvq"};
17
17
  require('./index.css')
18
18
 
19
19
  var Field = function (_a) {
package/field/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1e1al */
1
+ /* hash: 15ofi */
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 */
@@ -16,13 +16,13 @@
16
16
  } :root {
17
17
  } :root {
18
18
  --arrow-transform: rotate(180deg);
19
- } .custom-picker-button__iconContainer_1bejm {
19
+ } .custom-picker-button__iconContainer_zdnvq {
20
20
  display: flex;
21
21
  transition: transform 0.15s ease-in-out;
22
- } .custom-picker-button__addonsContainer_1bejm {
22
+ } .custom-picker-button__addonsContainer_zdnvq {
23
23
  display: flex
24
- } .custom-picker-button__addonsContainer_1bejm.custom-picker-button__showControlIcon_1bejm {
24
+ } .custom-picker-button__addonsContainer_zdnvq.custom-picker-button__showControlIcon_zdnvq {
25
25
  margin-right: var(--gap-2xs);
26
- } .custom-picker-button__open_1bejm {
26
+ } .custom-picker-button__open_zdnvq {
27
27
  transform: var(--arrow-transform);
28
28
  }
@@ -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-3e68f8db").OptionsListProps & {
36
40
  showClear?: boolean | undefined;
37
41
  onClose?: (() => void) | undefined;
38
42
  selectedDraft?: OptionShape[] | undefined;
39
- OptionsList?: import("react").FC<import("./index-3e68f8db").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined; /**
40
- * Пропсы, которые будут прокинуты в компонент списка
41
- */
43
+ OptionsList?: import("react").FC<import("./index-3e68f8db").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
42
44
  Footer?: import("react").FC<import("./Component-ebda875c").FooterProps> | undefined;
45
+ Header?: import("react").FC<import("./Component-ebda875c").HeaderProps> | undefined;
46
+ headerProps?: import("./Component-ebda875c").HeaderProps | undefined;
47
+ showHeaderWithSelectAll?: boolean | undefined;
43
48
  } & import("react").RefAttributes<HTMLDivElement>>;
44
49
  optionsListProps: {
45
50
  OptionsList: import("react").FC<import("./index-3e68f8db").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;
@@ -1,3 +1,3 @@
1
1
  export * from "./component-3885b0d7";
2
- export type { BottomSheetProps, BottomSheetTitleAlign } from "./types-5e678ff2";
2
+ export type { BottomSheetProps, BottomSheetTitleAlign } from "./types-fae20163";
3
3
  export { CLOSE_OFFSET, HEADER_OFFSET } from "./utils-b64479aa";
@@ -1,142 +1,12 @@
1
- /// <reference types="react-transition-group" />
2
1
  /// <reference types="react" />
2
+ /// <reference types="react-transition-group" />
3
3
  import React from 'react';
4
- import { FC, KeyboardEvent, MouseEvent, MutableRefObject, ReactNode, Ref } from "react";
5
- import { TransitionProps } from 'react-transition-group/Transition';
6
- import { BackdropProps, PortalProps } from "./index-ebda875c";
7
- type BaseModalProps = {
8
- /**
9
- * Контент
10
- */
11
- children?: ReactNode;
12
- /**
13
- * Компонент бэкдропа
14
- */
15
- Backdrop?: FC<BackdropProps>;
16
- /**
17
- * Свойства для Бэкдропа
18
- */
19
- backdropProps?: Partial<BackdropProps> & Record<string, unknown>;
20
- /**
21
- * Нода, компонент или функция возвращающая их
22
- *
23
- * Контейнер к которому будут добавляться порталы
24
- */
25
- container?: PortalProps['getPortalContainer'];
26
- /**
27
- * Отключает автоматический перевод фокуса на модалку при открытии
28
- * @default false
29
- */
30
- disableAutoFocus?: boolean;
31
- /**
32
- * Отключает ловушку фокуса
33
- * @default false
34
- */
35
- disableFocusLock?: boolean;
36
- /**
37
- * Отключает восстановление фокуса на предыдущем элементе после закрытия модалки
38
- * @default false
39
- */
40
- disableRestoreFocus?: boolean;
41
- /**
42
- * Отключает вызов `callback` при нажатии Escape
43
- * @default false
44
- */
45
- disableEscapeKeyDown?: boolean;
46
- /**
47
- * Отключает вызов `callback` при клике на бэкдроп
48
- * @default false
49
- */
50
- disableBackdropClick?: boolean;
51
- /**
52
- * Отключает блокировку скролла при открытии модального окна
53
- * @default false
54
- */
55
- disableBlockingScroll?: boolean;
56
- /**
57
- * Содержимое модалки всегда в DOM
58
- * @default false
59
- */
60
- keepMounted?: boolean;
61
- /**
62
- * Управление видимостью модалки
63
- */
64
- open: boolean;
65
- /**
66
- * Дополнительный класс
67
- */
68
- className?: string;
69
- /**
70
- * Дополнительный класс
71
- */
72
- contentClassName?: string;
73
- /**
74
- * Дополнительный класс для обертки (Modal)
75
- */
76
- wrapperClassName?: string;
77
- /**
78
- * Обработчик скролла контента
79
- */
80
- scrollHandler?: 'wrapper' | 'content' | MutableRefObject<HTMLDivElement | null>;
81
- /**
82
- * Пропсы для анимации (CSSTransition)
83
- */
84
- transitionProps?: Partial<TransitionProps>;
85
- /**
86
- * Рендерить ли в контейнер через портал.
87
- * @default true
88
- */
89
- usePortal?: boolean;
90
- /**
91
- * Обработчик события нажатия на бэкдроп
92
- */
93
- onBackdropClick?: (event: MouseEvent) => void;
94
- /**
95
- * Обработчик события нажатия на Escape
96
- *
97
- * Если `disableEscapeKeyDown` - false и модальное окно в фокусе
98
- */
99
- onEscapeKeyDown?: (event: KeyboardEvent) => void;
100
- /**
101
- * Обработчик закрытия
102
- */
103
- onClose?: (event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>, reason?: 'backdropClick' | 'escapeKeyDown' | 'closerClick') => void;
104
- /**
105
- * Обработчик события onEntered компонента Transition
106
- */
107
- onMount?: () => void;
108
- /**
109
- * Обработчик события onExited компонента Transition
110
- */
111
- onUnmount?: () => void;
112
- /**
113
- * Идентификатор для систем автоматизированного тестирования
114
- */
115
- dataTestId?: string;
116
- /**
117
- * z-index компонента
118
- */
119
- zIndex?: number;
120
- /**
121
- * Реф, который должен быть установлен компонентной области
122
- */
123
- componentRef?: MutableRefObject<HTMLDivElement | null>;
124
- };
125
- type BaseModalContext = {
126
- parentRef: React.RefObject<HTMLDivElement>;
127
- componentRef: React.RefObject<HTMLDivElement>;
128
- hasFooter?: boolean;
129
- hasHeader?: boolean;
130
- hasScroll?: boolean;
131
- headerHighlighted?: boolean;
132
- footerHighlighted?: boolean;
133
- headerOffset?: number;
134
- setHeaderOffset: (offset: number) => void;
135
- contentRef: Ref<HTMLElement>;
136
- setHasHeader: (exists: boolean) => void;
137
- setHasFooter: (exists: boolean) => void;
138
- onClose: Required<BaseModalProps>['onClose'];
4
+ import { CheckboxProps } from "./index-ebda875c";
5
+ type HeaderProps = {
6
+ checked?: boolean;
7
+ indeterminate?: boolean;
8
+ onChange?: CheckboxProps['onChange'];
9
+ mobile?: boolean;
139
10
  };
140
- declare const BaseModalContext: React.Context<BaseModalContext>;
141
- declare const BaseModal: React.ForwardRefExoticComponent<BaseModalProps & React.RefAttributes<HTMLDivElement>>;
142
- export { BaseModalProps, BaseModalContext, BaseModal };
11
+ declare const Header: React.FC<HeaderProps>;
12
+ export { HeaderProps, Header };
@@ -4,7 +4,7 @@ import { FC, RefObject, ReactNode } from "react";
4
4
  import { NavigationBarProps } from "./index-e81c389f";
5
5
  import { SwipeableHandlers } from "react-swipeable";
6
6
  import { BackdropProps } from "./index-ebda875c";
7
- import { BottomSheetProps } from "./types-5e678ff2";
7
+ import { BottomSheetProps } from "./types-fae20163";
8
8
  type HeaderProps = Omit<NavigationBarProps, "view" | "size"> & {
9
9
  headerRef: RefObject<HTMLDivElement>;
10
10
  };
@@ -3,7 +3,7 @@ import cn from 'classnames';
3
3
  import { CustomButton } from '@alfalab/core-components-custom-button/modern';
4
4
  import { getIcon } from '@alfalab/core-components-picker-button/modern';
5
5
 
6
- const styles = {"iconContainer":"custom-picker-button__iconContainer_1bejm","addonsContainer":"custom-picker-button__addonsContainer_1bejm","showControlIcon":"custom-picker-button__showControlIcon_1bejm","open":"custom-picker-button__open_1bejm"};
6
+ const styles = {"iconContainer":"custom-picker-button__iconContainer_zdnvq","addonsContainer":"custom-picker-button__addonsContainer_zdnvq","showControlIcon":"custom-picker-button__showControlIcon_zdnvq","open":"custom-picker-button__open_zdnvq"};
7
7
  require('./index.css')
8
8
 
9
9
  const Field = ({ buttonSize = 'm', buttonVariant = 'default', backgroundColor, contentColor, stateType, label, open, rightAddons, innerProps, className, showArrow = true, ...restProps }) => {
@@ -1,4 +1,4 @@
1
- /* hash: 1e1al */
1
+ /* hash: 15ofi */
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 */
@@ -16,13 +16,13 @@
16
16
  } :root {
17
17
  } :root {
18
18
  --arrow-transform: rotate(180deg);
19
- } .custom-picker-button__iconContainer_1bejm {
19
+ } .custom-picker-button__iconContainer_zdnvq {
20
20
  display: flex;
21
21
  transition: transform 0.15s ease-in-out;
22
- } .custom-picker-button__addonsContainer_1bejm {
22
+ } .custom-picker-button__addonsContainer_zdnvq {
23
23
  display: flex
24
- } .custom-picker-button__addonsContainer_1bejm.custom-picker-button__showControlIcon_1bejm {
24
+ } .custom-picker-button__addonsContainer_zdnvq.custom-picker-button__showControlIcon_zdnvq {
25
25
  margin-right: var(--gap-2xs);
26
- } .custom-picker-button__open_1bejm {
26
+ } .custom-picker-button__open_zdnvq {
27
27
  transform: var(--arrow-transform);
28
28
  }
@@ -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-3e68f8db").OptionsListProps & {
36
40
  showClear?: boolean | undefined;
37
41
  onClose?: (() => void) | undefined;
38
42
  selectedDraft?: OptionShape[] | undefined;
39
- OptionsList?: import("react").FC<import("./index-3e68f8db").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined; /**
40
- * Пропсы, которые будут прокинуты в компонент списка
41
- */
43
+ OptionsList?: import("react").FC<import("./index-3e68f8db").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
42
44
  Footer?: import("react").FC<import("./Component-ebda875c").FooterProps> | undefined;
45
+ Header?: import("react").FC<import("./Component-ebda875c").HeaderProps> | undefined;
46
+ headerProps?: import("./Component-ebda875c").HeaderProps | undefined;
47
+ showHeaderWithSelectAll?: boolean | undefined;
43
48
  } & import("react").RefAttributes<HTMLDivElement>>;
44
49
  optionsListProps: {
45
50
  OptionsList: import("react").FC<import("./index-3e68f8db").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;
@@ -1,3 +1,3 @@
1
1
  export * from "./component-3885b0d7";
2
- export type { BottomSheetProps, BottomSheetTitleAlign } from "./types-5e678ff2";
2
+ export type { BottomSheetProps, BottomSheetTitleAlign } from "./types-fae20163";
3
3
  export { CLOSE_OFFSET, HEADER_OFFSET } from "./utils-b64479aa";
@@ -161,6 +161,10 @@ type BottomSheetProps = {
161
161
  * Отключает блокировку скролла при открытии модального окна
162
162
  */
163
163
  disableBlockingScroll?: boolean;
164
+ /**
165
+ * Отключает ловушку фокуса
166
+ */
167
+ disableFocusLock?: boolean;
164
168
  /**
165
169
  * @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
166
170
  * Не анимировать шторку при изменении размера вьюпорта
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-custom-picker-button",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Custom picker button component",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -18,7 +18,7 @@
18
18
  "react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
19
19
  },
20
20
  "dependencies": {
21
- "@alfalab/core-components-picker-button": "^10.3.24",
21
+ "@alfalab/core-components-picker-button": "^10.3.26",
22
22
  "@alfalab/core-components-custom-button": "^3.2.0",
23
23
  "@alfalab/core-components-mq": "^4.1.4",
24
24
  "classnames": "^2.3.1",
@@ -161,6 +161,10 @@ type BottomSheetProps = {
161
161
  * Отключает блокировку скролла при открытии модального окна
162
162
  */
163
163
  disableBlockingScroll?: boolean;
164
+ /**
165
+ * Отключает ловушку фокуса
166
+ */
167
+ disableFocusLock?: boolean;
164
168
  /**
165
169
  * @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
166
170
  * Не анимировать шторку при изменении размера вьюпорта