@alfalab/core-components-picker-button 11.6.8 → 11.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{cssm/Component-57569e57.d.ts → Component-1fe708ea.d.ts} +1 -1
- package/Component-bdb4c6b9.d.ts +2 -1
- package/Component-c44170fe.d.ts +1 -1
- package/Component.responsive.d.ts +2 -1
- package/{esm/ResponsiveContext-88b743b5.d.ts → ResponsiveContext-d6bfd5b7.d.ts} +1 -1
- package/{Component-57569e57.d.ts → cssm/Component-1fe708ea.d.ts} +1 -1
- package/cssm/Component-bdb4c6b9.d.ts +2 -1
- package/cssm/Component-c44170fe.d.ts +1 -1
- package/cssm/Component.responsive.d.ts +2 -1
- package/{modern/ResponsiveContext-88b743b5.d.ts → cssm/ResponsiveContext-d6bfd5b7.d.ts} +1 -1
- package/cssm/desktop/Component.desktop.d.ts +11 -3
- package/cssm/desktop/Component.desktop.js +2 -1
- package/cssm/field/Component.d.ts +4 -2
- package/cssm/field/Component.js +2 -2
- package/cssm/iconMap-09d2f9c9.d.ts +4 -0
- package/cssm/index-09d2f9c9.d.ts +38 -0
- package/{esm/index-a5b021bd.d.ts → cssm/index-307da6d7.d.ts} +2 -1
- package/cssm/index-bdb4c6b9.d.ts +11 -4
- package/cssm/mobile/Component.mobile.js +2 -1
- package/{esm/types-667e33fd.d.ts → cssm/types-a870d1f8.d.ts} +2 -2
- package/cssm/{typings-57569e57.d.ts → typings-1fe708ea.d.ts} +17 -15
- package/{esm/typings-88b743b5.d.ts → cssm/typings-d6bfd5b7.d.ts} +4 -0
- package/cssm/use-skeleton-1328ead9.d.ts +4 -0
- package/cssm/utils/index.d.ts +5 -3
- package/cssm/utils/index.js +9 -2
- package/cssm/utils-89376c31.d.ts +1 -1
- package/desktop/Component.desktop.d.ts +11 -3
- package/desktop/Component.desktop.js +3 -2
- package/esm/{Component-57569e57.d.ts → Component-1fe708ea.d.ts} +1 -1
- package/esm/Component-bdb4c6b9.d.ts +2 -1
- package/esm/Component-c44170fe.d.ts +1 -1
- package/esm/Component.responsive.d.ts +2 -1
- package/{cssm/ResponsiveContext-88b743b5.d.ts → esm/ResponsiveContext-d6bfd5b7.d.ts} +1 -1
- package/esm/desktop/Component.desktop.d.ts +11 -3
- package/esm/desktop/Component.desktop.js +3 -2
- package/esm/field/Component.d.ts +4 -2
- package/esm/field/Component.js +3 -3
- package/esm/field/index.css +6 -6
- package/esm/iconMap-09d2f9c9.d.ts +4 -0
- package/esm/index-09d2f9c9.d.ts +38 -0
- package/{index-a5b021bd.d.ts → esm/index-307da6d7.d.ts} +2 -1
- package/esm/index-bdb4c6b9.d.ts +11 -4
- package/esm/index.css +5 -5
- package/esm/mobile/Component.mobile.js +2 -1
- package/esm/option/Component.js +1 -1
- package/esm/option/index.css +4 -4
- package/{modern/types-667e33fd.d.ts → esm/types-a870d1f8.d.ts} +2 -2
- package/esm/{typings-57569e57.d.ts → typings-1fe708ea.d.ts} +17 -15
- package/{modern/typings-88b743b5.d.ts → esm/typings-d6bfd5b7.d.ts} +4 -0
- package/esm/use-skeleton-1328ead9.d.ts +4 -0
- package/esm/utils/index.d.ts +5 -3
- package/esm/utils/index.js +9 -3
- package/esm/utils-89376c31.d.ts +1 -1
- package/field/Component.d.ts +4 -2
- package/field/Component.js +3 -3
- package/field/index.css +6 -6
- package/iconMap-09d2f9c9.d.ts +4 -0
- package/index-09d2f9c9.d.ts +38 -0
- package/{cssm/index-a5b021bd.d.ts → index-307da6d7.d.ts} +2 -1
- package/index-bdb4c6b9.d.ts +11 -4
- package/index.css +5 -5
- package/mobile/Component.mobile.js +2 -1
- package/modern/{Component-57569e57.d.ts → Component-1fe708ea.d.ts} +1 -1
- package/modern/Component-bdb4c6b9.d.ts +2 -1
- package/modern/Component-c44170fe.d.ts +1 -1
- package/modern/Component.responsive.d.ts +2 -1
- package/{ResponsiveContext-88b743b5.d.ts → modern/ResponsiveContext-d6bfd5b7.d.ts} +1 -1
- package/modern/desktop/Component.desktop.d.ts +11 -3
- package/modern/desktop/Component.desktop.js +3 -2
- package/modern/field/Component.d.ts +4 -2
- package/modern/field/Component.js +3 -3
- package/modern/field/index.css +6 -6
- package/modern/iconMap-09d2f9c9.d.ts +4 -0
- package/modern/index-09d2f9c9.d.ts +38 -0
- package/modern/{index-a5b021bd.d.ts → index-307da6d7.d.ts} +2 -1
- package/modern/index-bdb4c6b9.d.ts +11 -4
- package/modern/index.css +5 -5
- package/modern/mobile/Component.mobile.js +2 -1
- package/modern/option/Component.js +1 -1
- package/modern/option/index.css +4 -4
- package/{cssm/types-667e33fd.d.ts → modern/types-a870d1f8.d.ts} +2 -2
- package/modern/{typings-57569e57.d.ts → typings-1fe708ea.d.ts} +17 -15
- package/{cssm/typings-88b743b5.d.ts → modern/typings-d6bfd5b7.d.ts} +4 -0
- package/modern/use-skeleton-1328ead9.d.ts +4 -0
- package/modern/utils/index.d.ts +5 -3
- package/modern/utils/index.js +9 -3
- package/modern/utils-89376c31.d.ts +1 -1
- package/option/Component.js +1 -1
- package/option/index.css +4 -4
- package/package.json +3 -3
- package/src/desktop/Component.desktop.tsx +9 -2
- package/src/field/Component.tsx +6 -2
- package/src/mobile/Component.mobile.tsx +2 -0
- package/src/utils/index.ts +12 -3
- package/{types-667e33fd.d.ts → types-a870d1f8.d.ts} +2 -2
- package/{typings-57569e57.d.ts → typings-1fe708ea.d.ts} +17 -15
- package/{typings-88b743b5.d.ts → typings-d6bfd5b7.d.ts} +4 -0
- package/use-skeleton-1328ead9.d.ts +4 -0
- package/utils/index.d.ts +5 -3
- package/utils/index.js +9 -2
- package/utils-89376c31.d.ts +1 -1
- package/Component-064acd29.d.ts +0 -56
- package/cssm/Component-064acd29.d.ts +0 -56
- package/esm/Component-064acd29.d.ts +0 -56
- package/modern/Component-064acd29.d.ts +0 -56
- /package/{Component-a5b021bd.d.ts → Component-307da6d7.d.ts} +0 -0
- /package/cssm/{Component-a5b021bd.d.ts → Component-307da6d7.d.ts} +0 -0
- /package/esm/{Component-a5b021bd.d.ts → Component-307da6d7.d.ts} +0 -0
- /package/modern/{Component-a5b021bd.d.ts → Component-307da6d7.d.ts} +0 -0
package/modern/option/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 155u9 */
|
|
2
2
|
: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 */ /* 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
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 */
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
--gap-s: 12px;
|
|
16
16
|
} :root {
|
|
17
17
|
} :root {
|
|
18
|
-
} .picker-
|
|
18
|
+
} .picker-button__container_g1kh7 {
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
|
-
} .picker-
|
|
21
|
+
} .picker-button__icon_g1kh7 {
|
|
22
22
|
display: flex;
|
|
23
23
|
margin-right: var(--gap-s);
|
|
24
|
-
} .picker-
|
|
24
|
+
} .picker-button__content_g1kh7 {
|
|
25
25
|
overflow: hidden;
|
|
26
26
|
flex: 1;
|
|
27
27
|
text-overflow: ellipsis;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { BackArrowAddonProps, CloserProps } from "./index-ebda875c";
|
|
5
|
-
type
|
|
5
|
+
type NavigationBarPrivateProps = {
|
|
6
6
|
/**
|
|
7
7
|
* Контент шапки
|
|
8
8
|
*/
|
|
@@ -114,4 +114,4 @@ type ContentParams = {
|
|
|
114
114
|
style?: React.CSSProperties;
|
|
115
115
|
hidden?: boolean;
|
|
116
116
|
};
|
|
117
|
-
export {
|
|
117
|
+
export { NavigationBarPrivateProps, ContentParams };
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/// <reference types="react-transition-group" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { HTMLAttributes, ReactElement, ReactNode, RefObject, FC, AriaAttributes, FocusEvent, MouseEvent, RefAttributes, SVGProps } from "react";
|
|
4
|
+
import { HTMLAttributes, ReactElement, ReactNode, RefObject, FC, AriaAttributes, ComponentType, FocusEvent, MouseEvent, RefAttributes, SVGProps } from "react";
|
|
5
5
|
import { HandledEvents } from "react-swipeable/es/types";
|
|
6
6
|
import { TransitionProps } from "react-transition-group/Transition";
|
|
7
7
|
import { BaseModalProps } from "./index-bdb4c6b9";
|
|
8
|
-
import {
|
|
8
|
+
import { NavigationBarPrivateProps } from "./types-a870d1f8";
|
|
9
|
+
import { NavigationBarPrivateProps as NavigationBarProps } from "./types-a870d1f8";
|
|
9
10
|
import { BackgroundColorType } from "./index-064acd29";
|
|
10
11
|
import { BaseInputProps, BackdropProps } from "./index-ebda875c";
|
|
11
12
|
import { SwipeableHandlers, SwipeDirections } from "react-swipeable";
|
|
12
13
|
import { FormControlProps } from "./index-c44170fe";
|
|
13
|
-
import { ModalResponsiveProps as ModalProps } from "./typings-
|
|
14
|
+
import { ModalResponsiveProps as ModalProps } from "./typings-d6bfd5b7";
|
|
14
15
|
import { PopoverProps } from "@alfalab/core-components-popover";
|
|
15
16
|
import { UseSelectWithApplyProps } from "./field/Component";
|
|
16
17
|
type BottomSheetTitleAlign = "center" | "left";
|
|
@@ -304,7 +305,7 @@ declare const Input: React.ForwardRefExoticComponent<Omit<BaseInputProps, "FormC
|
|
|
304
305
|
breakpoint?: number | undefined;
|
|
305
306
|
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
306
307
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
307
|
-
type HeaderProps = Omit<
|
|
308
|
+
type HeaderProps = Omit<NavigationBarPrivateProps, "size" | "view" | "parentRef">;
|
|
308
309
|
type FooterProps = {
|
|
309
310
|
/**
|
|
310
311
|
* Контент футера
|
|
@@ -332,12 +333,13 @@ declare const ModalResponsive: React.ForwardRefExoticComponent<import("./index-b
|
|
|
332
333
|
fullscreen?: boolean | undefined;
|
|
333
334
|
fixedPosition?: boolean | undefined;
|
|
334
335
|
hasCloser?: boolean | undefined;
|
|
336
|
+
iOSLock?: boolean | undefined;
|
|
335
337
|
} & {
|
|
336
338
|
breakpoint?: number | undefined;
|
|
337
339
|
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
338
340
|
} & React.RefAttributes<HTMLDivElement>> & {
|
|
339
341
|
Header: React.FC<HeaderProps>;
|
|
340
|
-
Content: React.FC<import("./typings-
|
|
342
|
+
Content: React.FC<import("./typings-d6bfd5b7").ContentProps>;
|
|
341
343
|
Footer: React.FC<FooterProps>;
|
|
342
344
|
Controls: React.FC<ControlsProps>;
|
|
343
345
|
};
|
|
@@ -370,7 +372,7 @@ type FooterProps$0 = {
|
|
|
370
372
|
dataTestId?: string;
|
|
371
373
|
};
|
|
372
374
|
declare const Footer$0: FC<FooterProps$0>;
|
|
373
|
-
type HeaderProps$0 = Omit<
|
|
375
|
+
type HeaderProps$0 = Omit<NavigationBarPrivateProps, "view" | "size"> & {
|
|
374
376
|
headerRef: RefObject<HTMLDivElement>;
|
|
375
377
|
headerOffset: number;
|
|
376
378
|
};
|
|
@@ -591,11 +593,11 @@ type BaseSelectProps = {
|
|
|
591
593
|
/**
|
|
592
594
|
* Компонент стрелки
|
|
593
595
|
*/
|
|
594
|
-
Arrow?:
|
|
596
|
+
Arrow?: ComponentType<ArrowProps> | null | false;
|
|
595
597
|
/**
|
|
596
598
|
* Компонент поля
|
|
597
599
|
*/
|
|
598
|
-
Field?:
|
|
600
|
+
Field?: ComponentType<FieldProps>;
|
|
599
601
|
/**
|
|
600
602
|
* Пропсы, которые будут прокинуты в компонент поля
|
|
601
603
|
*/
|
|
@@ -611,15 +613,15 @@ type BaseSelectProps = {
|
|
|
611
613
|
/**
|
|
612
614
|
* Компонент выпадающего меню
|
|
613
615
|
*/
|
|
614
|
-
OptionsList?:
|
|
616
|
+
OptionsList?: ComponentType<OptionsListProps & RefAttributes<HTMLDivElement>>;
|
|
615
617
|
/**
|
|
616
618
|
* Компонент группы
|
|
617
619
|
*/
|
|
618
|
-
Optgroup?:
|
|
620
|
+
Optgroup?: ComponentType<OptgroupProps>;
|
|
619
621
|
/**
|
|
620
622
|
* Компонент пункта меню
|
|
621
623
|
*/
|
|
622
|
-
Option?:
|
|
624
|
+
Option?: ComponentType<OptionProps>;
|
|
623
625
|
/**
|
|
624
626
|
* Включает отображение поиска
|
|
625
627
|
*/
|
|
@@ -627,7 +629,7 @@ type BaseSelectProps = {
|
|
|
627
629
|
/**
|
|
628
630
|
* Компонент поиска
|
|
629
631
|
*/
|
|
630
|
-
Search?:
|
|
632
|
+
Search?: ComponentType<SearchProps>;
|
|
631
633
|
/**
|
|
632
634
|
* Настройки поиска
|
|
633
635
|
*/
|
|
@@ -789,7 +791,7 @@ type OptionsListProps = {
|
|
|
789
791
|
/**
|
|
790
792
|
* Компонент пункта меню
|
|
791
793
|
*/
|
|
792
|
-
Option:
|
|
794
|
+
Option: ComponentType<OptionProps>;
|
|
793
795
|
/**
|
|
794
796
|
* Функция для получения пропсов для ячейки
|
|
795
797
|
*/
|
|
@@ -1066,8 +1068,8 @@ type SelectProps = BaseSelectProps & AdditionalMobileProps & ConditionalMobilePr
|
|
|
1066
1068
|
};
|
|
1067
1069
|
export { BottomSheet, CLOSE_OFFSET, HEADER_OFFSET, InputProps, Input, ModalResponsive as Modal, getModalTestIds, FooterProps$0 as FooterProps, Footer$0 as Footer, HeaderProps$0 as HeaderProps, Header$0 as Header, SwipeableBackdropProps, SwipeableBackdrop, horizontalDirections, ShouldSkipSwipingParams, SwipeDirection, AnyObject, OptionShape, GroupShape, BaseSelectChangePayload, BaseSelectProps, FieldProps, ArrowProps, OptionsListProps, OptgroupProps, OptionProps, CheckmarkProps, SearchProps, SelectFieldProps, AdditionalMobileProps, BottomSheetSelectMobileProps, ModalSelectMobileProps, SelectModalMobileProps, SelectMobileProps, SelectDesktopProps, SelectProps };
|
|
1068
1070
|
export type { BottomSheetProps, BottomSheetTitleAlign, HeaderProps as ModalHeaderProps, FooterProps as ModalFooterProps };
|
|
1069
|
-
export { ModalResponsiveProps as ModalProps } from "./typings-
|
|
1071
|
+
export { ModalResponsiveProps as ModalProps } from "./typings-d6bfd5b7";
|
|
1070
1072
|
export { ModalContext } from "./Context-c2e6f1b2";
|
|
1071
|
-
export type { ContentProps as ModalContentProps } from "./typings-
|
|
1073
|
+
export type { ContentProps as ModalContentProps } from "./typings-d6bfd5b7";
|
|
1072
1074
|
export * from "./Component.desktop-63dec22f";
|
|
1073
1075
|
export * from "./Component.mobile-96988a65";
|
|
@@ -22,6 +22,10 @@ type ModalDesktopProps = BaseModalProps & {
|
|
|
22
22
|
* @default false
|
|
23
23
|
*/
|
|
24
24
|
hasCloser?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Блокирует скролл когда модальное окно открыто. Работает только на iOS.
|
|
27
|
+
*/
|
|
28
|
+
iOSLock?: boolean;
|
|
25
29
|
};
|
|
26
30
|
type ModalMobileProps = Omit<ModalDesktopProps, 'size' | 'fixedPosition' | 'fullscreen'>;
|
|
27
31
|
type ModalResponsiveProps = ModalDesktopProps & {
|
package/modern/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentType, SVGProps } from 'react';
|
|
2
3
|
import { PickerButtonVariant } from "../types";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
4
|
+
declare const getCompactIcon: (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => import("react").FC<SVGProps<SVGSVGElement>> | import("react").ComponentClass<SVGProps<SVGSVGElement>, any>;
|
|
5
|
+
declare const getIcon: (variant: PickerButtonVariant, size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => ComponentType<SVGProps<SVGSVGElement>>;
|
|
6
|
+
export { getCompactIcon, getIcon };
|
package/modern/utils/index.js
CHANGED
|
@@ -3,11 +3,17 @@ import { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
|
3
3
|
import { MoreMIcon } from '@alfalab/icons-glyph/MoreMIcon';
|
|
4
4
|
import { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const getCompactIcon = (size, Icon) => {
|
|
7
|
+
if (Icon) {
|
|
8
|
+
return Icon;
|
|
9
|
+
}
|
|
10
|
+
return size === 'size-32' ? MoreSIcon : MoreMIcon;
|
|
11
|
+
};
|
|
12
|
+
const getIcon = (variant, size, Icon) => {
|
|
7
13
|
if (variant === 'compact') {
|
|
8
|
-
return size
|
|
14
|
+
return getCompactIcon(size, Icon);
|
|
9
15
|
}
|
|
10
16
|
return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;
|
|
11
17
|
};
|
|
12
18
|
|
|
13
|
-
export { getIcon };
|
|
19
|
+
export { getCompactIcon, getIcon };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode, RefObject } from 'react';
|
|
2
|
-
import { BaseSelectProps, GroupShape, OptionShape } from "./typings-
|
|
2
|
+
import { BaseSelectProps, GroupShape, OptionShape } from "./typings-1fe708ea";
|
|
3
3
|
declare const isGroup: (item: OptionShape | GroupShape) => item is GroupShape;
|
|
4
4
|
declare const isOptionShape: (item: OptionShape | string | null) => item is OptionShape;
|
|
5
5
|
declare const joinOptions: ({ selected, selectedMultiple, }: {
|
package/option/Component.js
CHANGED
|
@@ -10,7 +10,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
12
12
|
|
|
13
|
-
var styles = {"container":"picker-
|
|
13
|
+
var styles = {"container":"picker-button__container_g1kh7","icon":"picker-button__icon_g1kh7","content":"picker-button__content_g1kh7"};
|
|
14
14
|
require('./index.css')
|
|
15
15
|
|
|
16
16
|
var Option = function (_a) {
|
package/option/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 155u9 */
|
|
2
2
|
: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 */ /* 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
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 */
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
--gap-s: 12px;
|
|
16
16
|
} :root {
|
|
17
17
|
} :root {
|
|
18
|
-
} .picker-
|
|
18
|
+
} .picker-button__container_g1kh7 {
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
|
-
} .picker-
|
|
21
|
+
} .picker-button__icon_g1kh7 {
|
|
22
22
|
display: flex;
|
|
23
23
|
margin-right: var(--gap-s);
|
|
24
|
-
} .picker-
|
|
24
|
+
} .picker-button__content_g1kh7 {
|
|
25
25
|
overflow: hidden;
|
|
26
26
|
flex: 1;
|
|
27
27
|
text-overflow: ellipsis;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-picker-button",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.7.1",
|
|
4
4
|
"description": "Picker button component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@alfalab/core-components-button": "^11.4.
|
|
19
|
-
"@alfalab/core-components-select": "^17.4.
|
|
18
|
+
"@alfalab/core-components-button": "^11.4.3",
|
|
19
|
+
"@alfalab/core-components-select": "^17.4.4",
|
|
20
20
|
"@alfalab/core-components-popover": "^6.2.1",
|
|
21
21
|
"@alfalab/hooks": "^1.13.0",
|
|
22
22
|
"@alfalab/icons-glyph": "^2.139.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ComponentType, forwardRef, SVGProps } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
4
|
import type { ButtonProps } from '@alfalab/core-components-button';
|
|
@@ -41,7 +41,7 @@ export type PickerButtonDesktopProps = Omit<
|
|
|
41
41
|
/**
|
|
42
42
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
43
43
|
*/
|
|
44
|
-
icon?:
|
|
44
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
45
45
|
}
|
|
46
46
|
>;
|
|
47
47
|
|
|
@@ -61,6 +61,11 @@ export type PickerButtonDesktopProps = Omit<
|
|
|
61
61
|
* @default true
|
|
62
62
|
*/
|
|
63
63
|
showArrow?: boolean;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Кастомная иконка при variant = compact
|
|
67
|
+
*/
|
|
68
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
64
69
|
};
|
|
65
70
|
|
|
66
71
|
export const PickerButtonDesktop = forwardRef<HTMLInputElement, PickerButtonDesktopProps>(
|
|
@@ -81,6 +86,7 @@ export const PickerButtonDesktop = forwardRef<HTMLInputElement, PickerButtonDesk
|
|
|
81
86
|
showArrow,
|
|
82
87
|
Field = DefaultField,
|
|
83
88
|
fieldProps = {},
|
|
89
|
+
icon,
|
|
84
90
|
...restProps
|
|
85
91
|
},
|
|
86
92
|
ref,
|
|
@@ -98,6 +104,7 @@ export const PickerButtonDesktop = forwardRef<HTMLInputElement, PickerButtonDesk
|
|
|
98
104
|
rightAddons,
|
|
99
105
|
showArrow,
|
|
100
106
|
breakpoint: 1,
|
|
107
|
+
icon,
|
|
101
108
|
};
|
|
102
109
|
|
|
103
110
|
return (
|
package/src/field/Component.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ButtonHTMLAttributes,
|
|
1
|
+
import React, { ButtonHTMLAttributes, ComponentType, Fragment, SVGProps } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
4
|
import { Button, ButtonProps } from '@alfalab/core-components-button';
|
|
@@ -14,6 +14,7 @@ type FieldProps = Omit<BaseFieldProps, 'size' | 'hint' | 'success' | 'error' | '
|
|
|
14
14
|
buttonSize?: PickerButtonSize;
|
|
15
15
|
buttonVariant?: PickerButtonVariant;
|
|
16
16
|
showArrow?: boolean;
|
|
17
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
const SIZE_TO_CLASSNAME_MAP = {
|
|
@@ -49,11 +50,14 @@ export const Field = ({
|
|
|
49
50
|
valueRenderer,
|
|
50
51
|
showArrow = true,
|
|
51
52
|
labelView,
|
|
53
|
+
FormControlComponent,
|
|
54
|
+
icon,
|
|
52
55
|
...restProps
|
|
53
56
|
}: FieldProps) => {
|
|
54
|
-
const Icon:
|
|
57
|
+
const Icon: ComponentType<SVGProps<SVGSVGElement>> = getIcon(
|
|
55
58
|
buttonVariant,
|
|
56
59
|
SIZE_TO_CLASSNAME_MAP[buttonSize],
|
|
60
|
+
icon,
|
|
57
61
|
);
|
|
58
62
|
|
|
59
63
|
const { ref, ...restInnerProps } = innerProps;
|
|
@@ -41,6 +41,7 @@ export const PickerButtonMobile = forwardRef<HTMLInputElement, PickerButtonMobil
|
|
|
41
41
|
showArrow,
|
|
42
42
|
Field = DefaultField,
|
|
43
43
|
fieldProps = {},
|
|
44
|
+
icon,
|
|
44
45
|
breakpoint = 1024,
|
|
45
46
|
...restProps
|
|
46
47
|
},
|
|
@@ -56,6 +57,7 @@ export const PickerButtonMobile = forwardRef<HTMLInputElement, PickerButtonMobil
|
|
|
56
57
|
rightAddons,
|
|
57
58
|
showArrow,
|
|
58
59
|
breakpoint,
|
|
60
|
+
icon,
|
|
59
61
|
};
|
|
60
62
|
|
|
61
63
|
return (
|
package/src/utils/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentType, SVGProps } from 'react';
|
|
2
2
|
|
|
3
3
|
import { ChevronDownCompactSIcon } from '@alfalab/icons-glyph/ChevronDownCompactSIcon';
|
|
4
4
|
import { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
@@ -7,12 +7,21 @@ import { MoreSIcon } from '@alfalab/icons-glyph/MoreSIcon';
|
|
|
7
7
|
|
|
8
8
|
import { PickerButtonVariant } from '../types';
|
|
9
9
|
|
|
10
|
+
export const getCompactIcon = (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => {
|
|
11
|
+
if (Icon) {
|
|
12
|
+
return Icon;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return size === 'size-32' ? MoreSIcon : MoreMIcon;
|
|
16
|
+
};
|
|
17
|
+
|
|
10
18
|
export const getIcon = (
|
|
11
19
|
variant: PickerButtonVariant,
|
|
12
20
|
size: string,
|
|
13
|
-
|
|
21
|
+
Icon?: ComponentType<SVGProps<SVGSVGElement>>,
|
|
22
|
+
): ComponentType<SVGProps<SVGSVGElement>> => {
|
|
14
23
|
if (variant === 'compact') {
|
|
15
|
-
return size
|
|
24
|
+
return getCompactIcon(size, Icon);
|
|
16
25
|
}
|
|
17
26
|
|
|
18
27
|
return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon : ChevronDownMIcon;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { BackArrowAddonProps, CloserProps } from "./index-ebda875c";
|
|
5
|
-
type
|
|
5
|
+
type NavigationBarPrivateProps = {
|
|
6
6
|
/**
|
|
7
7
|
* Контент шапки
|
|
8
8
|
*/
|
|
@@ -114,4 +114,4 @@ type ContentParams = {
|
|
|
114
114
|
style?: React.CSSProperties;
|
|
115
115
|
hidden?: boolean;
|
|
116
116
|
};
|
|
117
|
-
export {
|
|
117
|
+
export { NavigationBarPrivateProps, ContentParams };
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/// <reference types="react-transition-group" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { HTMLAttributes, ReactElement, ReactNode, RefObject, FC, AriaAttributes, FocusEvent, MouseEvent, RefAttributes, SVGProps } from "react";
|
|
4
|
+
import { HTMLAttributes, ReactElement, ReactNode, RefObject, FC, AriaAttributes, ComponentType, FocusEvent, MouseEvent, RefAttributes, SVGProps } from "react";
|
|
5
5
|
import { HandledEvents } from "react-swipeable/es/types";
|
|
6
6
|
import { TransitionProps } from "react-transition-group/Transition";
|
|
7
7
|
import { BaseModalProps } from "./index-bdb4c6b9";
|
|
8
|
-
import {
|
|
8
|
+
import { NavigationBarPrivateProps } from "./types-a870d1f8";
|
|
9
|
+
import { NavigationBarPrivateProps as NavigationBarProps } from "./types-a870d1f8";
|
|
9
10
|
import { BackgroundColorType } from "./index-064acd29";
|
|
10
11
|
import { BaseInputProps, BackdropProps } from "./index-ebda875c";
|
|
11
12
|
import { SwipeableHandlers, SwipeDirections } from "react-swipeable";
|
|
12
13
|
import { FormControlProps } from "./index-c44170fe";
|
|
13
|
-
import { ModalResponsiveProps as ModalProps } from "./typings-
|
|
14
|
+
import { ModalResponsiveProps as ModalProps } from "./typings-d6bfd5b7";
|
|
14
15
|
import { PopoverProps } from "@alfalab/core-components-popover";
|
|
15
16
|
import { UseSelectWithApplyProps } from "./field/Component";
|
|
16
17
|
type BottomSheetTitleAlign = "center" | "left";
|
|
@@ -304,7 +305,7 @@ declare const Input: React.ForwardRefExoticComponent<Omit<BaseInputProps, "FormC
|
|
|
304
305
|
breakpoint?: number | undefined;
|
|
305
306
|
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
306
307
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
307
|
-
type HeaderProps = Omit<
|
|
308
|
+
type HeaderProps = Omit<NavigationBarPrivateProps, "size" | "view" | "parentRef">;
|
|
308
309
|
type FooterProps = {
|
|
309
310
|
/**
|
|
310
311
|
* Контент футера
|
|
@@ -332,12 +333,13 @@ declare const ModalResponsive: React.ForwardRefExoticComponent<import("./index-b
|
|
|
332
333
|
fullscreen?: boolean | undefined;
|
|
333
334
|
fixedPosition?: boolean | undefined;
|
|
334
335
|
hasCloser?: boolean | undefined;
|
|
336
|
+
iOSLock?: boolean | undefined;
|
|
335
337
|
} & {
|
|
336
338
|
breakpoint?: number | undefined;
|
|
337
339
|
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
338
340
|
} & React.RefAttributes<HTMLDivElement>> & {
|
|
339
341
|
Header: React.FC<HeaderProps>;
|
|
340
|
-
Content: React.FC<import("./typings-
|
|
342
|
+
Content: React.FC<import("./typings-d6bfd5b7").ContentProps>;
|
|
341
343
|
Footer: React.FC<FooterProps>;
|
|
342
344
|
Controls: React.FC<ControlsProps>;
|
|
343
345
|
};
|
|
@@ -370,7 +372,7 @@ type FooterProps$0 = {
|
|
|
370
372
|
dataTestId?: string;
|
|
371
373
|
};
|
|
372
374
|
declare const Footer$0: FC<FooterProps$0>;
|
|
373
|
-
type HeaderProps$0 = Omit<
|
|
375
|
+
type HeaderProps$0 = Omit<NavigationBarPrivateProps, "view" | "size"> & {
|
|
374
376
|
headerRef: RefObject<HTMLDivElement>;
|
|
375
377
|
headerOffset: number;
|
|
376
378
|
};
|
|
@@ -591,11 +593,11 @@ type BaseSelectProps = {
|
|
|
591
593
|
/**
|
|
592
594
|
* Компонент стрелки
|
|
593
595
|
*/
|
|
594
|
-
Arrow?:
|
|
596
|
+
Arrow?: ComponentType<ArrowProps> | null | false;
|
|
595
597
|
/**
|
|
596
598
|
* Компонент поля
|
|
597
599
|
*/
|
|
598
|
-
Field?:
|
|
600
|
+
Field?: ComponentType<FieldProps>;
|
|
599
601
|
/**
|
|
600
602
|
* Пропсы, которые будут прокинуты в компонент поля
|
|
601
603
|
*/
|
|
@@ -611,15 +613,15 @@ type BaseSelectProps = {
|
|
|
611
613
|
/**
|
|
612
614
|
* Компонент выпадающего меню
|
|
613
615
|
*/
|
|
614
|
-
OptionsList?:
|
|
616
|
+
OptionsList?: ComponentType<OptionsListProps & RefAttributes<HTMLDivElement>>;
|
|
615
617
|
/**
|
|
616
618
|
* Компонент группы
|
|
617
619
|
*/
|
|
618
|
-
Optgroup?:
|
|
620
|
+
Optgroup?: ComponentType<OptgroupProps>;
|
|
619
621
|
/**
|
|
620
622
|
* Компонент пункта меню
|
|
621
623
|
*/
|
|
622
|
-
Option?:
|
|
624
|
+
Option?: ComponentType<OptionProps>;
|
|
623
625
|
/**
|
|
624
626
|
* Включает отображение поиска
|
|
625
627
|
*/
|
|
@@ -627,7 +629,7 @@ type BaseSelectProps = {
|
|
|
627
629
|
/**
|
|
628
630
|
* Компонент поиска
|
|
629
631
|
*/
|
|
630
|
-
Search?:
|
|
632
|
+
Search?: ComponentType<SearchProps>;
|
|
631
633
|
/**
|
|
632
634
|
* Настройки поиска
|
|
633
635
|
*/
|
|
@@ -789,7 +791,7 @@ type OptionsListProps = {
|
|
|
789
791
|
/**
|
|
790
792
|
* Компонент пункта меню
|
|
791
793
|
*/
|
|
792
|
-
Option:
|
|
794
|
+
Option: ComponentType<OptionProps>;
|
|
793
795
|
/**
|
|
794
796
|
* Функция для получения пропсов для ячейки
|
|
795
797
|
*/
|
|
@@ -1066,8 +1068,8 @@ type SelectProps = BaseSelectProps & AdditionalMobileProps & ConditionalMobilePr
|
|
|
1066
1068
|
};
|
|
1067
1069
|
export { BottomSheet, CLOSE_OFFSET, HEADER_OFFSET, InputProps, Input, ModalResponsive as Modal, getModalTestIds, FooterProps$0 as FooterProps, Footer$0 as Footer, HeaderProps$0 as HeaderProps, Header$0 as Header, SwipeableBackdropProps, SwipeableBackdrop, horizontalDirections, ShouldSkipSwipingParams, SwipeDirection, AnyObject, OptionShape, GroupShape, BaseSelectChangePayload, BaseSelectProps, FieldProps, ArrowProps, OptionsListProps, OptgroupProps, OptionProps, CheckmarkProps, SearchProps, SelectFieldProps, AdditionalMobileProps, BottomSheetSelectMobileProps, ModalSelectMobileProps, SelectModalMobileProps, SelectMobileProps, SelectDesktopProps, SelectProps };
|
|
1068
1070
|
export type { BottomSheetProps, BottomSheetTitleAlign, HeaderProps as ModalHeaderProps, FooterProps as ModalFooterProps };
|
|
1069
|
-
export { ModalResponsiveProps as ModalProps } from "./typings-
|
|
1071
|
+
export { ModalResponsiveProps as ModalProps } from "./typings-d6bfd5b7";
|
|
1070
1072
|
export { ModalContext } from "./Context-c2e6f1b2";
|
|
1071
|
-
export type { ContentProps as ModalContentProps } from "./typings-
|
|
1073
|
+
export type { ContentProps as ModalContentProps } from "./typings-d6bfd5b7";
|
|
1072
1074
|
export * from "./Component.desktop-63dec22f";
|
|
1073
1075
|
export * from "./Component.mobile-96988a65";
|
|
@@ -22,6 +22,10 @@ type ModalDesktopProps = BaseModalProps & {
|
|
|
22
22
|
* @default false
|
|
23
23
|
*/
|
|
24
24
|
hasCloser?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Блокирует скролл когда модальное окно открыто. Работает только на iOS.
|
|
27
|
+
*/
|
|
28
|
+
iOSLock?: boolean;
|
|
25
29
|
};
|
|
26
30
|
type ModalMobileProps = Omit<ModalDesktopProps, 'size' | 'fixedPosition' | 'fullscreen'>;
|
|
27
31
|
type ModalResponsiveProps = ModalDesktopProps & {
|
package/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentType, SVGProps } from 'react';
|
|
2
3
|
import { PickerButtonVariant } from "../types";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
4
|
+
declare const getCompactIcon: (size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => import("react").FC<SVGProps<SVGSVGElement>> | import("react").ComponentClass<SVGProps<SVGSVGElement>, any>;
|
|
5
|
+
declare const getIcon: (variant: PickerButtonVariant, size: string, Icon?: ComponentType<SVGProps<SVGSVGElement>>) => ComponentType<SVGProps<SVGSVGElement>>;
|
|
6
|
+
export { getCompactIcon, getIcon };
|
package/utils/index.js
CHANGED
|
@@ -7,11 +7,18 @@ var ChevronDownMIcon = require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
|
7
7
|
var MoreMIcon = require('@alfalab/icons-glyph/MoreMIcon');
|
|
8
8
|
var MoreSIcon = require('@alfalab/icons-glyph/MoreSIcon');
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var getCompactIcon = function (size, Icon) {
|
|
11
|
+
if (Icon) {
|
|
12
|
+
return Icon;
|
|
13
|
+
}
|
|
14
|
+
return size === 'size-32' ? MoreSIcon.MoreSIcon : MoreMIcon.MoreMIcon;
|
|
15
|
+
};
|
|
16
|
+
var getIcon = function (variant, size, Icon) {
|
|
11
17
|
if (variant === 'compact') {
|
|
12
|
-
return size
|
|
18
|
+
return getCompactIcon(size, Icon);
|
|
13
19
|
}
|
|
14
20
|
return ['size-40', 'size-32'].includes(size) ? ChevronDownCompactSIcon.ChevronDownCompactSIcon : ChevronDownMIcon.ChevronDownMIcon;
|
|
15
21
|
};
|
|
16
22
|
|
|
23
|
+
exports.getCompactIcon = getCompactIcon;
|
|
17
24
|
exports.getIcon = getIcon;
|
package/utils-89376c31.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode, RefObject } from 'react';
|
|
2
|
-
import { BaseSelectProps, GroupShape, OptionShape } from "./typings-
|
|
2
|
+
import { BaseSelectProps, GroupShape, OptionShape } from "./typings-1fe708ea";
|
|
3
3
|
declare const isGroup: (item: OptionShape | GroupShape) => item is GroupShape;
|
|
4
4
|
declare const isOptionShape: (item: OptionShape | string | null) => item is OptionShape;
|
|
5
5
|
declare const joinOptions: ({ selected, selectedMultiple, }: {
|