@alfalab/core-components-picker-button 11.6.7 → 11.7.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/{cssm/Component-57569e57.d.ts → Component-1fe708ea.d.ts} +1 -1
- package/Component-bdb4c6b9.d.ts +2 -1
- package/Component-c44170fe.d.ts +26 -2
- 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 +26 -2
- 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/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} +35 -17
- package/{esm/typings-88b743b5.d.ts → cssm/typings-d6bfd5b7.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 +26 -2
- package/esm/Component.responsive.d.ts +2 -1
- package/{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/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/{cssm/types-667e33fd.d.ts → esm/types-a870d1f8.d.ts} +2 -2
- package/esm/{typings-57569e57.d.ts → typings-1fe708ea.d.ts} +35 -17
- package/{modern/typings-88b743b5.d.ts → esm/typings-d6bfd5b7.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/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 +26 -2
- package/modern/Component.responsive.d.ts +2 -1
- package/{cssm/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/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/modern/{types-667e33fd.d.ts → types-a870d1f8.d.ts} +2 -2
- package/modern/{typings-57569e57.d.ts → typings-1fe708ea.d.ts} +35 -17
- package/{cssm/typings-88b743b5.d.ts → modern/typings-d6bfd5b7.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 +2 -2
- 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} +35 -17
- package/{typings-88b743b5.d.ts → typings-d6bfd5b7.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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { OptgroupProps } from "./typings-
|
|
3
|
+
import { OptgroupProps } from "./typings-1fe708ea";
|
|
4
4
|
declare const Optgroup: ({ children, className, label, size }: OptgroupProps) => React.JSX.Element;
|
|
5
5
|
export { Optgroup };
|
package/Component-bdb4c6b9.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { View } from "./typings-
|
|
3
|
+
import { View } from "./typings-d6bfd5b7";
|
|
4
4
|
declare const Modal: React.ForwardRefExoticComponent<import("./index-bdb4c6b9").BaseModalProps & {
|
|
5
5
|
size?: "s" | "m" | "l" | "xl" | 500 | "fullscreen" | 600 | 800 | 1140 | undefined;
|
|
6
6
|
fullscreen?: boolean | undefined;
|
|
7
7
|
fixedPosition?: boolean | undefined;
|
|
8
8
|
hasCloser?: boolean | undefined;
|
|
9
|
+
iOSLock?: boolean | undefined;
|
|
9
10
|
} & {
|
|
10
11
|
view: View;
|
|
11
12
|
} & React.RefAttributes<HTMLDivElement>>;
|
package/Component-c44170fe.d.ts
CHANGED
|
@@ -2,10 +2,35 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { ChangeEvent, ElementType, HTMLAttributes, InputHTMLAttributes, MouseEvent, ReactNode, RefAttributes } from "react";
|
|
4
4
|
import { FormControlProps } from "./index-c44170fe";
|
|
5
|
+
type StatusBadgeProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Дополнительный класс
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Размер компонента
|
|
12
|
+
* @default 24
|
|
13
|
+
*/
|
|
14
|
+
size?: 16 | 20 | 24 | 32 | 40;
|
|
15
|
+
/**
|
|
16
|
+
* Набор цветов для компонента
|
|
17
|
+
*/
|
|
18
|
+
colors?: "default" | "inverted";
|
|
19
|
+
/**
|
|
20
|
+
* Вид бейджа.
|
|
21
|
+
*/
|
|
22
|
+
view: "positive-checkmark" | "negative-cross" | "negative-alert" | "negative-block" | "attention-alert" | "neutral-information" | "neutral-operation" | "neutral-cross";
|
|
23
|
+
/**
|
|
24
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
25
|
+
*/
|
|
26
|
+
dataTestId?: string;
|
|
27
|
+
};
|
|
28
|
+
declare const StatusBadge: ({ className, dataTestId, size, view, colors }: StatusBadgeProps) => React.JSX.Element;
|
|
5
29
|
interface ClearButtonProps {
|
|
6
30
|
disabled?: boolean;
|
|
7
31
|
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
8
32
|
colors: "default" | "inverted";
|
|
33
|
+
dataTestId?: string;
|
|
9
34
|
}
|
|
10
35
|
declare const ClearButton: React.FC<ClearButtonProps>;
|
|
11
36
|
type BaseInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'value' | 'defaultValue' | 'onChange' | 'onClick' | 'onMouseDown' | 'enterKeyHint'> & {
|
|
@@ -287,5 +312,4 @@ declare const BaseInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAtt
|
|
|
287
312
|
*/
|
|
288
313
|
disableUserInput?: boolean | undefined;
|
|
289
314
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
290
|
-
export
|
|
291
|
-
export { ClearButton, BaseInputProps, BaseInput };
|
|
315
|
+
export { StatusBadgeProps, StatusBadge, ClearButton, BaseInputProps, BaseInput };
|
|
@@ -11,11 +11,12 @@ type PickerButtonResponsiveProps = PickerButtonDesktopProps & AdditionalMobilePr
|
|
|
11
11
|
};
|
|
12
12
|
declare const PickerButtonResponsive: React.ForwardRefExoticComponent<Omit<import("@alfalab/core-components-select/shared").BaseSelectProps, "size" | "hint" | "placeholder" | "onFocus" | "selected" | "multiple" | "options" | "showSearch" | "searchProps" | "autocomplete" | "allowUnselect" | "closeOnSelect" | "Arrow" | "Search"> & Pick<import("@alfalab/core-components-button").ButtonProps, "view" | "leftAddons" | "rightAddons" | "loading"> & {
|
|
13
13
|
options: ((import("@alfalab/core-components-select/shared").OptionShape | import("@alfalab/core-components-select/shared").GroupShape) & {
|
|
14
|
-
icon?: React.
|
|
14
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>> | undefined;
|
|
15
15
|
})[];
|
|
16
16
|
size?: import("./types").PickerButtonSize | undefined;
|
|
17
17
|
variant?: import("./types").PickerButtonVariant | undefined;
|
|
18
18
|
showArrow?: boolean | undefined;
|
|
19
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>> | undefined;
|
|
19
20
|
} & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
20
21
|
/**
|
|
21
22
|
* Контрольная точка, с нее начинается desktop версия
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { TResponsiveModalContext } from "./typings-
|
|
3
|
+
import { TResponsiveModalContext } from "./typings-d6bfd5b7";
|
|
4
4
|
declare const ResponsiveContext: React.Context<TResponsiveModalContext>;
|
|
5
5
|
export { ResponsiveContext };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { OptgroupProps } from "./typings-
|
|
3
|
+
import { OptgroupProps } from "./typings-1fe708ea";
|
|
4
4
|
declare const Optgroup: ({ children, className, label, size }: OptgroupProps) => React.JSX.Element;
|
|
5
5
|
export { Optgroup };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { View } from "./typings-
|
|
3
|
+
import { View } from "./typings-d6bfd5b7";
|
|
4
4
|
declare const Modal: React.ForwardRefExoticComponent<import("./index-bdb4c6b9").BaseModalProps & {
|
|
5
5
|
size?: "s" | "m" | "l" | "xl" | 500 | "fullscreen" | 600 | 800 | 1140 | undefined;
|
|
6
6
|
fullscreen?: boolean | undefined;
|
|
7
7
|
fixedPosition?: boolean | undefined;
|
|
8
8
|
hasCloser?: boolean | undefined;
|
|
9
|
+
iOSLock?: boolean | undefined;
|
|
9
10
|
} & {
|
|
10
11
|
view: View;
|
|
11
12
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -2,10 +2,35 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { ChangeEvent, ElementType, HTMLAttributes, InputHTMLAttributes, MouseEvent, ReactNode, RefAttributes } from "react";
|
|
4
4
|
import { FormControlProps } from "./index-c44170fe";
|
|
5
|
+
type StatusBadgeProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Дополнительный класс
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Размер компонента
|
|
12
|
+
* @default 24
|
|
13
|
+
*/
|
|
14
|
+
size?: 16 | 20 | 24 | 32 | 40;
|
|
15
|
+
/**
|
|
16
|
+
* Набор цветов для компонента
|
|
17
|
+
*/
|
|
18
|
+
colors?: "default" | "inverted";
|
|
19
|
+
/**
|
|
20
|
+
* Вид бейджа.
|
|
21
|
+
*/
|
|
22
|
+
view: "positive-checkmark" | "negative-cross" | "negative-alert" | "negative-block" | "attention-alert" | "neutral-information" | "neutral-operation" | "neutral-cross";
|
|
23
|
+
/**
|
|
24
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
25
|
+
*/
|
|
26
|
+
dataTestId?: string;
|
|
27
|
+
};
|
|
28
|
+
declare const StatusBadge: ({ className, dataTestId, size, view, colors }: StatusBadgeProps) => React.JSX.Element;
|
|
5
29
|
interface ClearButtonProps {
|
|
6
30
|
disabled?: boolean;
|
|
7
31
|
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
8
32
|
colors: "default" | "inverted";
|
|
33
|
+
dataTestId?: string;
|
|
9
34
|
}
|
|
10
35
|
declare const ClearButton: React.FC<ClearButtonProps>;
|
|
11
36
|
type BaseInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'value' | 'defaultValue' | 'onChange' | 'onClick' | 'onMouseDown' | 'enterKeyHint'> & {
|
|
@@ -287,5 +312,4 @@ declare const BaseInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAtt
|
|
|
287
312
|
*/
|
|
288
313
|
disableUserInput?: boolean | undefined;
|
|
289
314
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
290
|
-
export
|
|
291
|
-
export { ClearButton, BaseInputProps, BaseInput };
|
|
315
|
+
export { StatusBadgeProps, StatusBadge, ClearButton, BaseInputProps, BaseInput };
|
|
@@ -11,11 +11,12 @@ type PickerButtonResponsiveProps = PickerButtonDesktopProps & AdditionalMobilePr
|
|
|
11
11
|
};
|
|
12
12
|
declare const PickerButtonResponsive: React.ForwardRefExoticComponent<Omit<import("@alfalab/core-components-select/shared").BaseSelectProps, "size" | "hint" | "placeholder" | "onFocus" | "selected" | "multiple" | "options" | "showSearch" | "searchProps" | "autocomplete" | "allowUnselect" | "closeOnSelect" | "Arrow" | "Search"> & Pick<import("@alfalab/core-components-button").ButtonProps, "view" | "leftAddons" | "rightAddons" | "loading"> & {
|
|
13
13
|
options: ((import("@alfalab/core-components-select/shared").OptionShape | import("@alfalab/core-components-select/shared").GroupShape) & {
|
|
14
|
-
icon?: React.
|
|
14
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>> | undefined;
|
|
15
15
|
})[];
|
|
16
16
|
size?: import("./types").PickerButtonSize | undefined;
|
|
17
17
|
variant?: import("./types").PickerButtonVariant | undefined;
|
|
18
18
|
showArrow?: boolean | undefined;
|
|
19
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>> | undefined;
|
|
19
20
|
} & AdditionalMobileProps & BottomSheetSelectMobileProps & {
|
|
20
21
|
/**
|
|
21
22
|
* Контрольная точка, с нее начинается desktop версия
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { TResponsiveModalContext } from "./typings-
|
|
3
|
+
import { TResponsiveModalContext } from "./typings-d6bfd5b7";
|
|
4
4
|
declare const ResponsiveContext: React.Context<TResponsiveModalContext>;
|
|
5
5
|
export { ResponsiveContext };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ComponentType, SVGProps } from "react";
|
|
4
4
|
import { ButtonProps } from "@alfalab/core-components-button";
|
|
5
5
|
import { BaseSelectProps } from "@alfalab/core-components-select/shared";
|
|
6
6
|
import { PickerButtonSize, PickerButtonVariant } from "../types";
|
|
@@ -9,7 +9,7 @@ type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholder' | 'Arrow' |
|
|
|
9
9
|
/**
|
|
10
10
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
11
11
|
*/
|
|
12
|
-
icon?:
|
|
12
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
13
13
|
}>;
|
|
14
14
|
/**
|
|
15
15
|
* Размер кнопки
|
|
@@ -25,13 +25,17 @@ type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholder' | 'Arrow' |
|
|
|
25
25
|
* @default true
|
|
26
26
|
*/
|
|
27
27
|
showArrow?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Кастомная иконка при variant = compact
|
|
30
|
+
*/
|
|
31
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
28
32
|
};
|
|
29
33
|
declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "size" | "hint" | "placeholder" | "onFocus" | "selected" | "multiple" | "options" | "showSearch" | "searchProps" | "autocomplete" | "allowUnselect" | "closeOnSelect" | "Arrow" | "Search"> & Pick<ButtonProps, "view" | "leftAddons" | "rightAddons" | "loading"> & {
|
|
30
34
|
options: Array<BaseSelectProps['options'][0] & {
|
|
31
35
|
/**
|
|
32
36
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
33
37
|
*/
|
|
34
|
-
icon?:
|
|
38
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
35
39
|
}>;
|
|
36
40
|
/**
|
|
37
41
|
* Размер кнопки
|
|
@@ -47,5 +51,9 @@ declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<BaseSele
|
|
|
47
51
|
* @default true
|
|
48
52
|
*/
|
|
49
53
|
showArrow?: boolean | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Кастомная иконка при variant = compact
|
|
56
|
+
*/
|
|
57
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>> | undefined;
|
|
50
58
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
51
59
|
export { PickerButtonDesktopProps, PickerButtonDesktop };
|
|
@@ -20,7 +20,7 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
|
20
20
|
var SIDE_POSITIONS = ['right', 'right-start', 'right-end', 'left', 'left-start', 'left-end'];
|
|
21
21
|
var PickerButtonDesktop = React.forwardRef(function (_a, ref) {
|
|
22
22
|
var _b;
|
|
23
|
-
var _c = _a.OptionsList, OptionsList = _c === void 0 ? shared.OptionsList : _c, _d = _a.Optgroup, Optgroup = _d === void 0 ? shared.Optgroup : _d, _e = _a.Option, Option = _e === void 0 ? option_Component.Option : _e, view = _a.view, loading = _a.loading, _f = _a.size, size = _f === void 0 ? 56 : _f, _g = _a.variant, variant = _g === void 0 ? 'default' : _g, className = _a.className, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, popperClassName = _a.popperClassName, optionClassName = _a.optionClassName, showArrow = _a.showArrow, _h = _a.Field, Field = _h === void 0 ? field_Component.Field : _h, _j = _a.fieldProps, fieldProps = _j === void 0 ? {} : _j, restProps = tslib.__rest(_a, ["OptionsList", "Optgroup", "Option", "view", "loading", "size", "variant", "className", "leftAddons", "rightAddons", "popperClassName", "optionClassName", "showArrow", "Field", "fieldProps"]);
|
|
23
|
+
var _c = _a.OptionsList, OptionsList = _c === void 0 ? shared.OptionsList : _c, _d = _a.Optgroup, Optgroup = _d === void 0 ? shared.Optgroup : _d, _e = _a.Option, Option = _e === void 0 ? option_Component.Option : _e, view = _a.view, loading = _a.loading, _f = _a.size, size = _f === void 0 ? 56 : _f, _g = _a.variant, variant = _g === void 0 ? 'default' : _g, className = _a.className, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, popperClassName = _a.popperClassName, optionClassName = _a.optionClassName, showArrow = _a.showArrow, _h = _a.Field, Field = _h === void 0 ? field_Component.Field : _h, _j = _a.fieldProps, fieldProps = _j === void 0 ? {} : _j, icon = _a.icon, restProps = tslib.__rest(_a, ["OptionsList", "Optgroup", "Option", "view", "loading", "size", "variant", "className", "leftAddons", "rightAddons", "popperClassName", "optionClassName", "showArrow", "Field", "fieldProps", "icon"]);
|
|
24
24
|
var isSideGap = !!restProps.popoverPosition && SIDE_POSITIONS.includes(restProps.popoverPosition);
|
|
25
25
|
var fieldDefaultProps = {
|
|
26
26
|
view: view,
|
|
@@ -32,6 +32,7 @@ var PickerButtonDesktop = React.forwardRef(function (_a, ref) {
|
|
|
32
32
|
rightAddons: rightAddons,
|
|
33
33
|
showArrow: showArrow,
|
|
34
34
|
breakpoint: 1,
|
|
35
|
+
icon: icon,
|
|
35
36
|
};
|
|
36
37
|
return (React__default.default.createElement(shared.BaseSelect, tslib.__assign({}, restProps, { Popover: coreComponentsPopover.Popover, view: 'desktop', optionProps: { Checkmark: null }, ref: ref, Option: Option, Field: Field, size: size === 'm' || size === 56 ? 56 : 48, fieldProps: tslib.__assign(tslib.__assign({}, fieldDefaultProps), fieldProps), Optgroup: Optgroup, OptionsList: OptionsList, className: cn__default.default(styles__default.default.container, className), popperClassName: cn__default.default('cc-picker-button', styles__default.default.optionsPopover, popperClassName, (_b = {},
|
|
37
38
|
_b[styles__default.default.sideGap] = isSideGap,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { ComponentType, SVGProps } from "react";
|
|
3
4
|
import { ButtonProps } from "@alfalab/core-components-button";
|
|
4
|
-
import { FieldProps as BaseFieldProps } from "../typings-
|
|
5
|
+
import { FieldProps as BaseFieldProps } from "../typings-1fe708ea";
|
|
5
6
|
import { PickerButtonSize, PickerButtonVariant } from "../types";
|
|
6
7
|
type FieldProps = Omit<BaseFieldProps, 'size' | 'hint' | 'success' | 'error' | 'placeholder'> & ButtonProps & {
|
|
7
8
|
buttonSize?: PickerButtonSize;
|
|
8
9
|
buttonVariant?: PickerButtonVariant;
|
|
9
10
|
showArrow?: boolean;
|
|
11
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
10
12
|
};
|
|
11
|
-
declare const Field: ({ buttonSize, buttonVariant, view, label, open, multiple, rightAddons, Arrow, innerProps, className, selected, selectedMultiple, setSelectedItems, toggleMenu, valueRenderer, showArrow, labelView, ...restProps }: FieldProps) => React.JSX.Element;
|
|
13
|
+
declare const Field: ({ buttonSize, buttonVariant, view, label, open, multiple, rightAddons, Arrow, innerProps, className, selected, selectedMultiple, setSelectedItems, toggleMenu, valueRenderer, showArrow, labelView, FormControlComponent, icon, ...restProps }: FieldProps) => React.JSX.Element;
|
|
12
14
|
export { Field };
|
package/cssm/field/Component.js
CHANGED
|
@@ -31,8 +31,8 @@ var SIZE_TO_CLASSNAME_MAP = {
|
|
|
31
31
|
};
|
|
32
32
|
var Field = function (_a) {
|
|
33
33
|
var _b, _c;
|
|
34
|
-
var _d = _a.buttonSize, buttonSize = _d === void 0 ? 56 : _d, _e = _a.buttonVariant, buttonVariant = _e === void 0 ? 'default' : _e, view = _a.view, label = _a.label, open = _a.open; _a.multiple; var rightAddons = _a.rightAddons; _a.Arrow; var innerProps = _a.innerProps, className = _a.className; _a.selected; _a.selectedMultiple; _a.setSelectedItems; _a.toggleMenu; _a.valueRenderer; var _f = _a.showArrow, showArrow = _f === void 0 ? true : _f; _a.labelView; var restProps = tslib.__rest(_a, ["buttonSize", "buttonVariant", "view", "label", "open", "multiple", "rightAddons", "Arrow", "innerProps", "className", "selected", "selectedMultiple", "setSelectedItems", "toggleMenu", "valueRenderer", "showArrow", "labelView"]);
|
|
35
|
-
var Icon = utils_index.getIcon(buttonVariant, SIZE_TO_CLASSNAME_MAP[buttonSize]);
|
|
34
|
+
var _d = _a.buttonSize, buttonSize = _d === void 0 ? 56 : _d, _e = _a.buttonVariant, buttonVariant = _e === void 0 ? 'default' : _e, view = _a.view, label = _a.label, open = _a.open; _a.multiple; var rightAddons = _a.rightAddons; _a.Arrow; var innerProps = _a.innerProps, className = _a.className; _a.selected; _a.selectedMultiple; _a.setSelectedItems; _a.toggleMenu; _a.valueRenderer; var _f = _a.showArrow, showArrow = _f === void 0 ? true : _f; _a.labelView; _a.FormControlComponent; var icon = _a.icon, restProps = tslib.__rest(_a, ["buttonSize", "buttonVariant", "view", "label", "open", "multiple", "rightAddons", "Arrow", "innerProps", "className", "selected", "selectedMultiple", "setSelectedItems", "toggleMenu", "valueRenderer", "showArrow", "labelView", "FormControlComponent", "icon"]);
|
|
35
|
+
var Icon = utils_index.getIcon(buttonVariant, SIZE_TO_CLASSNAME_MAP[buttonSize], icon);
|
|
36
36
|
var ref = innerProps.ref, restInnerProps = tslib.__rest(innerProps, ["ref"]);
|
|
37
37
|
var buttonProps = tslib.__assign(tslib.__assign({}, restProps), restInnerProps);
|
|
38
38
|
return (React__default.default.createElement("div", { ref: ref },
|
package/cssm/index-bdb4c6b9.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// <reference types="react-transition-group" />
|
|
3
3
|
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
|
|
4
4
|
import React from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { ComponentType, KeyboardEvent, MouseEvent, MutableRefObject, ReactNode, Ref, FC, RefObject } from "react";
|
|
6
6
|
import { TransitionProps } from "react-transition-group/Transition";
|
|
7
7
|
import { BackdropProps } from "./index-ebda875c";
|
|
8
8
|
type PortalProps = {
|
|
@@ -25,7 +25,7 @@ type BaseModalProps = {
|
|
|
25
25
|
/**
|
|
26
26
|
* Компонент бэкдропа
|
|
27
27
|
*/
|
|
28
|
-
Backdrop?:
|
|
28
|
+
Backdrop?: ComponentType<BackdropProps>;
|
|
29
29
|
/**
|
|
30
30
|
* Свойства для Бэкдропа
|
|
31
31
|
*/
|
|
@@ -146,6 +146,10 @@ type BaseModalProps = {
|
|
|
146
146
|
* Реф, который должен быть установлен компонентной области
|
|
147
147
|
*/
|
|
148
148
|
componentRef?: MutableRefObject<HTMLDivElement | null>;
|
|
149
|
+
/**
|
|
150
|
+
* Блокирует скролл когда модальное окно открыто. Работает только на iOS.
|
|
151
|
+
*/
|
|
152
|
+
iOSLock?: boolean;
|
|
149
153
|
};
|
|
150
154
|
type BaseModalContext = {
|
|
151
155
|
parentRef: React.RefObject<HTMLDivElement>;
|
|
@@ -169,7 +173,7 @@ declare function isScrolledToTop(target: HTMLElement): boolean;
|
|
|
169
173
|
declare function isScrolledToBottom(target: HTMLElement): boolean;
|
|
170
174
|
declare function hasScrollbar(target: HTMLElement): boolean;
|
|
171
175
|
declare const restoreContainerStyles: (container: HTMLElement) => void;
|
|
172
|
-
declare const handleContainer: (container?: HTMLElement) => void;
|
|
176
|
+
declare const handleContainer: (container?: HTMLElement, shouldIOSLock?: boolean) => void;
|
|
173
177
|
/**
|
|
174
178
|
* Набор констант для z-index соответствующих классов компонентов.
|
|
175
179
|
* Значения выбраны по приоритету.
|
|
@@ -195,6 +199,9 @@ type StackProps = {
|
|
|
195
199
|
value?: number;
|
|
196
200
|
};
|
|
197
201
|
declare const Stack: FC<StackProps>;
|
|
202
|
+
declare const lockScroll: () => void;
|
|
203
|
+
declare const unlockScroll: () => void;
|
|
204
|
+
declare const syncHeight: () => void;
|
|
198
205
|
declare const PORTAL_CONTAINER_ATTRIBUTE = "alfa-portal-container";
|
|
199
206
|
declare const getDefaultPortalContainer: () => Element;
|
|
200
207
|
declare function setRef<T>(ref: RefObject<T> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
|
|
@@ -219,5 +226,5 @@ declare class GlobalStore {
|
|
|
219
226
|
constructor();
|
|
220
227
|
getModalStore: () => ModalStore;
|
|
221
228
|
}
|
|
222
|
-
export { BaseModalProps, BaseModalContext, BaseModal, isScrolledToTop, isScrolledToBottom, hasScrollbar, restoreContainerStyles, handleContainer, stackingOrder, StackingContext, StackProps, Stack, PORTAL_CONTAINER_ATTRIBUTE, getDefaultPortalContainer, setRef, getModalStore, GlobalStore };
|
|
229
|
+
export { BaseModalProps, BaseModalContext, BaseModal, isScrolledToTop, isScrolledToBottom, hasScrollbar, restoreContainerStyles, handleContainer, stackingOrder, StackingContext, StackProps, Stack, lockScroll, unlockScroll, syncHeight, PORTAL_CONTAINER_ATTRIBUTE, getDefaultPortalContainer, setRef, getModalStore, GlobalStore };
|
|
223
230
|
export type { SavedStyle };
|
|
@@ -14,7 +14,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
14
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
15
|
|
|
16
16
|
var PickerButtonMobile = React.forwardRef(function (_a, ref) {
|
|
17
|
-
var options = _a.options, label = _a.label, _b = _a.Option, Option = _b === void 0 ? option_Component.Option : _b, _c = _a.Optgroup, Optgroup = _c === void 0 ? shared.Optgroup : _c, view = _a.view, loading = _a.loading, _d = _a.variant, variant = _d === void 0 ? 'default' : _d, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, size = _a.size, bottomSheetProps = _a.bottomSheetProps, showArrow = _a.showArrow, _e = _a.Field, Field = _e === void 0 ? field_Component.Field : _e, _f = _a.fieldProps, fieldProps = _f === void 0 ? {} : _f, _g = _a.breakpoint, breakpoint = _g === void 0 ? 1024 : _g, restProps = tslib.__rest(_a, ["options", "label", "Option", "Optgroup", "view", "loading", "variant", "leftAddons", "rightAddons", "size", "bottomSheetProps", "showArrow", "Field", "fieldProps", "breakpoint"]);
|
|
17
|
+
var options = _a.options, label = _a.label, _b = _a.Option, Option = _b === void 0 ? option_Component.Option : _b, _c = _a.Optgroup, Optgroup = _c === void 0 ? shared.Optgroup : _c, view = _a.view, loading = _a.loading, _d = _a.variant, variant = _d === void 0 ? 'default' : _d, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, size = _a.size, bottomSheetProps = _a.bottomSheetProps, showArrow = _a.showArrow, _e = _a.Field, Field = _e === void 0 ? field_Component.Field : _e, _f = _a.fieldProps, fieldProps = _f === void 0 ? {} : _f, icon = _a.icon, _g = _a.breakpoint, breakpoint = _g === void 0 ? 1024 : _g, restProps = tslib.__rest(_a, ["options", "label", "Option", "Optgroup", "view", "loading", "variant", "leftAddons", "rightAddons", "size", "bottomSheetProps", "showArrow", "Field", "fieldProps", "icon", "breakpoint"]);
|
|
18
18
|
var fieldDefaultProps = {
|
|
19
19
|
view: view,
|
|
20
20
|
loading: loading,
|
|
@@ -25,6 +25,7 @@ var PickerButtonMobile = React.forwardRef(function (_a, ref) {
|
|
|
25
25
|
rightAddons: rightAddons,
|
|
26
26
|
showArrow: showArrow,
|
|
27
27
|
breakpoint: breakpoint,
|
|
28
|
+
icon: icon,
|
|
28
29
|
};
|
|
29
30
|
return (React__default.default.createElement(mobile.SelectMobile, tslib.__assign({}, restProps, { label: label, Option: Option, bottomSheetProps: tslib.__assign({ title: label, stickyHeader: true }, bottomSheetProps), Field: Field, Optgroup: Optgroup, size: size === 'm' || size === 56 ? 56 : 48, closeOnSelect: true, fieldProps: tslib.__assign(tslib.__assign({}, fieldDefaultProps), fieldProps), ref: ref, options: options, selected: [] })));
|
|
30
31
|
});
|
|
@@ -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
|
-
import { SwipeableHandlers } from "react-swipeable";
|
|
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
|
};
|
|
@@ -390,6 +392,22 @@ type SwipeableBackdropProps = BackdropProps & {
|
|
|
390
392
|
opacityTimeout?: number;
|
|
391
393
|
};
|
|
392
394
|
declare const SwipeableBackdrop: FC<SwipeableBackdropProps>;
|
|
395
|
+
declare const horizontalDirections: [
|
|
396
|
+
string,
|
|
397
|
+
string
|
|
398
|
+
];
|
|
399
|
+
type ShouldSkipSwipingParams = {
|
|
400
|
+
deltaY: number;
|
|
401
|
+
startY: number;
|
|
402
|
+
event: HandledEvents;
|
|
403
|
+
dir: SwipeDirections;
|
|
404
|
+
};
|
|
405
|
+
declare enum SwipeDirection {
|
|
406
|
+
Left = "Left",
|
|
407
|
+
Right = "Right",
|
|
408
|
+
Up = "Up",
|
|
409
|
+
Down = "Down"
|
|
410
|
+
}
|
|
393
411
|
type AnyObject = Record<string, any>;
|
|
394
412
|
type OptionShape = {
|
|
395
413
|
/**
|
|
@@ -575,11 +593,11 @@ type BaseSelectProps = {
|
|
|
575
593
|
/**
|
|
576
594
|
* Компонент стрелки
|
|
577
595
|
*/
|
|
578
|
-
Arrow?:
|
|
596
|
+
Arrow?: ComponentType<ArrowProps> | null | false;
|
|
579
597
|
/**
|
|
580
598
|
* Компонент поля
|
|
581
599
|
*/
|
|
582
|
-
Field?:
|
|
600
|
+
Field?: ComponentType<FieldProps>;
|
|
583
601
|
/**
|
|
584
602
|
* Пропсы, которые будут прокинуты в компонент поля
|
|
585
603
|
*/
|
|
@@ -595,15 +613,15 @@ type BaseSelectProps = {
|
|
|
595
613
|
/**
|
|
596
614
|
* Компонент выпадающего меню
|
|
597
615
|
*/
|
|
598
|
-
OptionsList?:
|
|
616
|
+
OptionsList?: ComponentType<OptionsListProps & RefAttributes<HTMLDivElement>>;
|
|
599
617
|
/**
|
|
600
618
|
* Компонент группы
|
|
601
619
|
*/
|
|
602
|
-
Optgroup?:
|
|
620
|
+
Optgroup?: ComponentType<OptgroupProps>;
|
|
603
621
|
/**
|
|
604
622
|
* Компонент пункта меню
|
|
605
623
|
*/
|
|
606
|
-
Option?:
|
|
624
|
+
Option?: ComponentType<OptionProps>;
|
|
607
625
|
/**
|
|
608
626
|
* Включает отображение поиска
|
|
609
627
|
*/
|
|
@@ -611,7 +629,7 @@ type BaseSelectProps = {
|
|
|
611
629
|
/**
|
|
612
630
|
* Компонент поиска
|
|
613
631
|
*/
|
|
614
|
-
Search?:
|
|
632
|
+
Search?: ComponentType<SearchProps>;
|
|
615
633
|
/**
|
|
616
634
|
* Настройки поиска
|
|
617
635
|
*/
|
|
@@ -773,7 +791,7 @@ type OptionsListProps = {
|
|
|
773
791
|
/**
|
|
774
792
|
* Компонент пункта меню
|
|
775
793
|
*/
|
|
776
|
-
Option:
|
|
794
|
+
Option: ComponentType<OptionProps>;
|
|
777
795
|
/**
|
|
778
796
|
* Функция для получения пропсов для ячейки
|
|
779
797
|
*/
|
|
@@ -1048,10 +1066,10 @@ type SelectProps = BaseSelectProps & AdditionalMobileProps & ConditionalMobilePr
|
|
|
1048
1066
|
*/
|
|
1049
1067
|
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
1050
1068
|
};
|
|
1051
|
-
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, AnyObject, OptionShape, GroupShape, BaseSelectChangePayload, BaseSelectProps, FieldProps, ArrowProps, OptionsListProps, OptgroupProps, OptionProps, CheckmarkProps, SearchProps, SelectFieldProps, AdditionalMobileProps, BottomSheetSelectMobileProps, ModalSelectMobileProps, SelectModalMobileProps, SelectMobileProps, SelectDesktopProps, SelectProps };
|
|
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 };
|
|
1052
1070
|
export type { BottomSheetProps, BottomSheetTitleAlign, HeaderProps as ModalHeaderProps, FooterProps as ModalFooterProps };
|
|
1053
|
-
export { ModalResponsiveProps as ModalProps } from "./typings-
|
|
1071
|
+
export { ModalResponsiveProps as ModalProps } from "./typings-d6bfd5b7";
|
|
1054
1072
|
export { ModalContext } from "./Context-c2e6f1b2";
|
|
1055
|
-
export type { ContentProps as ModalContentProps } from "./typings-
|
|
1073
|
+
export type { ContentProps as ModalContentProps } from "./typings-d6bfd5b7";
|
|
1056
1074
|
export * from "./Component.desktop-63dec22f";
|
|
1057
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/cssm/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/cssm/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/cssm/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, }: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ComponentType, SVGProps } from "react";
|
|
4
4
|
import { ButtonProps } from "@alfalab/core-components-button";
|
|
5
5
|
import { BaseSelectProps } from "@alfalab/core-components-select/shared";
|
|
6
6
|
import { PickerButtonSize, PickerButtonVariant } from "../types";
|
|
@@ -9,7 +9,7 @@ type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholder' | 'Arrow' |
|
|
|
9
9
|
/**
|
|
10
10
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
11
11
|
*/
|
|
12
|
-
icon?:
|
|
12
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
13
13
|
}>;
|
|
14
14
|
/**
|
|
15
15
|
* Размер кнопки
|
|
@@ -25,13 +25,17 @@ type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholder' | 'Arrow' |
|
|
|
25
25
|
* @default true
|
|
26
26
|
*/
|
|
27
27
|
showArrow?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Кастомная иконка при variant = compact
|
|
30
|
+
*/
|
|
31
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
28
32
|
};
|
|
29
33
|
declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "size" | "hint" | "placeholder" | "onFocus" | "selected" | "multiple" | "options" | "showSearch" | "searchProps" | "autocomplete" | "allowUnselect" | "closeOnSelect" | "Arrow" | "Search"> & Pick<ButtonProps, "view" | "leftAddons" | "rightAddons" | "loading"> & {
|
|
30
34
|
options: Array<BaseSelectProps['options'][0] & {
|
|
31
35
|
/**
|
|
32
36
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
33
37
|
*/
|
|
34
|
-
icon?:
|
|
38
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
35
39
|
}>;
|
|
36
40
|
/**
|
|
37
41
|
* Размер кнопки
|
|
@@ -47,5 +51,9 @@ declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<BaseSele
|
|
|
47
51
|
* @default true
|
|
48
52
|
*/
|
|
49
53
|
showArrow?: boolean | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Кастомная иконка при variant = compact
|
|
56
|
+
*/
|
|
57
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>> | undefined;
|
|
50
58
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
51
59
|
export { PickerButtonDesktopProps, PickerButtonDesktop };
|