@ozen-ui/kit 0.60.0 → 0.61.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/__inner__/cjs/components/Autocomplete/helper.d.ts +7 -72
- package/__inner__/cjs/components/Autocomplete/types.d.ts +11 -17
- package/__inner__/cjs/components/AutocompleteNext/helpers.d.ts +7 -77
- package/__inner__/cjs/components/AutocompleteNext/types.d.ts +10 -16
- package/__inner__/cjs/components/DatePicker/DatePicker.d.ts +2 -36
- package/__inner__/cjs/components/DatePicker/types.d.ts +5 -14
- package/__inner__/cjs/components/Segment/Segment.js +1 -1
- package/__inner__/cjs/components/Segment/components/SegmentItem/SegmentItem.js +1 -1
- package/__inner__/cjs/components/Select/Select.css +6 -0
- package/__inner__/cjs/components/Select/Select.js +41 -59
- package/__inner__/cjs/components/Select/components/SelectInput/SelectInput.js +5 -6
- package/__inner__/cjs/components/Select/components/SelectInputContextConsumer/SelectInputContextConsumer.d.ts +5 -0
- package/__inner__/cjs/components/Select/components/{SelectConsumer/SelectInputConsumer.js → SelectInputContextConsumer/SelectInputContextConsumer.js} +3 -3
- package/__inner__/cjs/components/Select/components/SelectInputContextConsumer/index.d.ts +1 -0
- package/__inner__/cjs/components/Select/components/{SelectConsumer → SelectInputContextConsumer}/index.js +1 -1
- package/__inner__/cjs/components/Select/helpers/types.d.ts +5 -8
- package/__inner__/cjs/components/Select/helpers/types.js +5 -1
- package/__inner__/cjs/components/Select/types.d.ts +43 -41
- package/__inner__/cjs/components/Stack/types.d.ts +2 -2
- package/__inner__/esm/components/Autocomplete/helper.d.ts +7 -72
- package/__inner__/esm/components/Autocomplete/types.d.ts +11 -17
- package/__inner__/esm/components/AutocompleteNext/helpers.d.ts +7 -77
- package/__inner__/esm/components/AutocompleteNext/types.d.ts +10 -16
- package/__inner__/esm/components/DatePicker/DatePicker.d.ts +2 -36
- package/__inner__/esm/components/DatePicker/types.d.ts +5 -14
- package/__inner__/esm/components/Segment/Segment.js +1 -1
- package/__inner__/esm/components/Segment/components/SegmentItem/SegmentItem.js +1 -1
- package/__inner__/esm/components/Select/Select.css +6 -0
- package/__inner__/esm/components/Select/Select.js +42 -60
- package/__inner__/esm/components/Select/components/SelectInput/SelectInput.js +5 -6
- package/__inner__/esm/components/Select/components/SelectInputContextConsumer/SelectInputContextConsumer.d.ts +5 -0
- package/__inner__/esm/components/Select/components/{SelectConsumer/SelectInputConsumer.js → SelectInputContextConsumer/SelectInputContextConsumer.js} +1 -1
- package/__inner__/esm/components/Select/components/SelectInputContextConsumer/index.d.ts +1 -0
- package/__inner__/esm/components/Select/components/SelectInputContextConsumer/index.js +1 -0
- package/__inner__/esm/components/Select/helpers/types.d.ts +5 -8
- package/__inner__/esm/components/Select/helpers/types.js +2 -0
- package/__inner__/esm/components/Select/types.d.ts +43 -41
- package/__inner__/esm/components/Stack/types.d.ts +2 -2
- package/package.json +4 -4
- package/__inner__/cjs/components/Select/components/SelectConsumer/SelectInputConsumer.d.ts +0 -5
- package/__inner__/cjs/components/Select/components/SelectConsumer/index.d.ts +0 -1
- package/__inner__/esm/components/Select/components/SelectConsumer/SelectInputConsumer.d.ts +0 -5
- package/__inner__/esm/components/Select/components/SelectConsumer/index.d.ts +0 -1
- package/__inner__/esm/components/Select/components/SelectConsumer/index.js +0 -1
|
@@ -1,45 +1,37 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode, SyntheticEvent } from 'react';
|
|
2
2
|
import type { ExtendableComponentPropsWithRef } from '../../types/ExtendableComponentPropsWithRef';
|
|
3
3
|
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
4
|
-
import type { DataListBaseProps, DataListSelected } from '../DataList';
|
|
4
|
+
import type { DataListBaseProps, DataListOptionProps, DataListSelected } from '../DataList';
|
|
5
5
|
import type { SelectInputProps, SelectInputRef } from './components';
|
|
6
|
-
export type
|
|
7
|
-
export type SelectLabel =
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
11
|
-
label?:
|
|
6
|
+
export type SelectPropSize = FormElementSizeVariant;
|
|
7
|
+
export type SelectLabel<MULTIPLE extends boolean = false> = (MULTIPLE extends true ? DataListOptionProps['label'][] : DataListOptionProps['label']) | undefined;
|
|
8
|
+
export type SelectPropValue<MULTIPLE extends boolean = false> = DataListSelected<MULTIPLE>;
|
|
9
|
+
export type SelectPropOnChange<MULTIPLE extends boolean = false> = (value: SelectPropValue<MULTIPLE>, e: SyntheticEvent | KeyboardEvent) => void;
|
|
10
|
+
export type SelectedOption<MULTIPLE extends boolean = false> = {
|
|
11
|
+
label?: SelectLabel<MULTIPLE>;
|
|
12
12
|
value?: SelectPropValue<MULTIPLE>;
|
|
13
13
|
};
|
|
14
|
-
export type
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
type SelectUncontrolledProps<MULTIPLE extends boolean = false> = {
|
|
36
|
-
/** Значение поля по умолчанию (неконтролируемый компонент) */
|
|
37
|
-
defaultValue: SelectPropValue<MULTIPLE>;
|
|
38
|
-
/** Выбранное значение */
|
|
39
|
-
value?: never;
|
|
40
|
-
/** Обработчик события на изменение выбранного значения */
|
|
41
|
-
onChange?: never;
|
|
42
|
-
};
|
|
14
|
+
export type SelectPropRenderValue<MULTIPLE extends boolean = false> = (option: SelectedOption<MULTIPLE>) => ReactNode | null;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated
|
|
17
|
+
* Use the `SelectRenderValueProp` type to replace it.
|
|
18
|
+
* */
|
|
19
|
+
export type SelectRenderValue<MULTIPLE extends boolean = false> = SelectPropRenderValue<MULTIPLE>;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated
|
|
22
|
+
* Use the `SelectLabel` type to replace it.
|
|
23
|
+
* */
|
|
24
|
+
export type SelectPropLabel<MULTIPLE extends boolean = false> = SelectLabel<MULTIPLE>;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated
|
|
27
|
+
* Use the `SelectSizeProp` type to replace it.
|
|
28
|
+
* */
|
|
29
|
+
export type SelectSizeVariant = SelectPropSize;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated
|
|
32
|
+
* Use the `SelectedPropOption` type to replace it.
|
|
33
|
+
* */
|
|
34
|
+
export type SelectedOptionProp<MULTIPLE extends boolean = false> = SelectedOption<MULTIPLE>;
|
|
43
35
|
type SelectPropsDeprecated<MULTIPLE extends boolean = false> = {
|
|
44
36
|
/**
|
|
45
37
|
* Свойства компонента Menu
|
|
@@ -52,21 +44,31 @@ export type SelectProps<MULTIPLE extends boolean = false> = ExtendableComponentP
|
|
|
52
44
|
/** Если `true` устанавливает автофокус */
|
|
53
45
|
autoFocus?: boolean;
|
|
54
46
|
/** Размер компонента */
|
|
55
|
-
size?:
|
|
47
|
+
size?: SelectPropSize;
|
|
48
|
+
/** Текущее состояние списка. Если `true`, список отображается. */
|
|
49
|
+
open?: boolean;
|
|
50
|
+
/** Состояние открытие по умолчанию (неконтролируемый компонент) */
|
|
51
|
+
defaultOpen?: boolean;
|
|
52
|
+
/** Выбранное значение */
|
|
53
|
+
value?: SelectPropValue<MULTIPLE>;
|
|
54
|
+
/** Обработчик события на изменение выбранного значения */
|
|
55
|
+
onChange?: SelectPropOnChange<MULTIPLE>;
|
|
56
|
+
/** Значение поля по умолчанию (неконтролируемый компонент) */
|
|
57
|
+
defaultValue?: SelectPropValue<MULTIPLE>;
|
|
56
58
|
/** Рендер-функция для выбранного значения */
|
|
57
|
-
renderValue?:
|
|
59
|
+
renderValue?: SelectPropRenderValue<MULTIPLE>;
|
|
58
60
|
/** Содержимое компонента */
|
|
59
61
|
children?: ReactNode;
|
|
60
62
|
/** Свойства компонента DataList */
|
|
61
63
|
dataListProps?: Partial<Omit<DataListBaseProps<MULTIPLE>, 'onClose' | 'open' | 'anchorRef' | 'multiple' | 'selected' | 'onSelect'>>;
|
|
62
64
|
/** Функция обратного вызова, которая будет вызвана когда компонент запрашивает закрытие */
|
|
63
|
-
onClose
|
|
65
|
+
onClose?(): void;
|
|
64
66
|
/** Функция обратного вызова, которая будет вызвана когда компонент запрашивает открытие */
|
|
65
|
-
onOpen
|
|
67
|
+
onOpen?(): void;
|
|
66
68
|
/** Если `true` из списка можно выбрать несколько вариантов */
|
|
67
69
|
multiple?: MULTIPLE;
|
|
68
70
|
/** Идентификатор компонента для тестов */
|
|
69
71
|
'data-testid'?: string;
|
|
70
|
-
} & Pick<SelectInputProps, 'id' | 'name' | 'label' | 'placeholder' | 'disabled' | 'required' | 'disableStroke' | 'error' | 'hint' | 'fullWidth' | 'renderLeft' | 'renderRight' | 'multiline' | 'inputProps' | 'labelProps' | 'hintProps' | 'bodyProps' | 'inputRef' | 'labelRef' | 'bodyRef'> & SelectPropsDeprecated<MULTIPLE
|
|
72
|
+
} & Pick<SelectInputProps, 'id' | 'name' | 'label' | 'placeholder' | 'disabled' | 'required' | 'disableStroke' | 'error' | 'hint' | 'fullWidth' | 'renderLeft' | 'renderRight' | 'multiline' | 'inputProps' | 'labelProps' | 'hintProps' | 'bodyProps' | 'inputRef' | 'labelRef' | 'bodyRef'> & SelectPropsDeprecated<MULTIPLE>, 'div'>;
|
|
71
73
|
export type SelectComponent = <MULTIPLE extends boolean = false>(props: SelectProps<MULTIPLE>) => ReactElement | null;
|
|
72
74
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ElementType, ReactElement } from 'react';
|
|
2
2
|
import type { ResponsiveValue } from '../../types/ResponsiveValue';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
4
4
|
export declare const stackGapVariant: readonly ["0", "xs", "s", "m", "l", "xl", "2xl", "3xl", "4xl", "5xl", "6xl", "7xl", "8xl"];
|
|
5
5
|
export declare const stackDirectionVariant: readonly ["row", "column", "rowReverse", "columnReverse"];
|
|
6
6
|
export declare const stackAlignVariant: readonly ["center", "start", "end", "baseline"];
|
|
@@ -27,4 +27,4 @@ export type StackBaseProps = {
|
|
|
27
27
|
/** React-элемент для разделителя между дочерними компонентами стека */
|
|
28
28
|
divider?: ReactElement;
|
|
29
29
|
};
|
|
30
|
-
export type StackProps<As extends ElementType = 'div'> =
|
|
30
|
+
export type StackProps<As extends ElementType = 'div'> = PolymorphicComponentPropsWithRef<StackBaseProps, As>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ozen-ui/kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.0",
|
|
4
4
|
"description": "React component library",
|
|
5
5
|
"files": [
|
|
6
6
|
"*"
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"react-popper": "^2.3.0",
|
|
28
28
|
"react-transition-group": "^4.4.5",
|
|
29
29
|
"tslib": "^2.6.3",
|
|
30
|
-
"@ozen-ui/
|
|
31
|
-
"@ozen-ui/
|
|
32
|
-
"@ozen-ui/logger": "0.
|
|
30
|
+
"@ozen-ui/fonts": "0.61.0",
|
|
31
|
+
"@ozen-ui/icons": "0.61.0",
|
|
32
|
+
"@ozen-ui/logger": "0.61.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": ">=17.0.2 <19.0.0",
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { SelectInputProps } from '../SelectInput';
|
|
3
|
-
type SelectInputConsumerProps = Pick<SelectInputProps, 'value' | 'placeholder' | 'defaultValue' | 'id' | 'name' | 'fieldProps' | 'fieldRef' | 'inputProps' | 'inputRef' | 'renderedValue'>;
|
|
4
|
-
export declare const SelectInputConsumer: FC<SelectInputConsumerProps>;
|
|
5
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SelectInputConsumer';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { SelectInputProps } from '../SelectInput';
|
|
3
|
-
type SelectInputConsumerProps = Pick<SelectInputProps, 'value' | 'placeholder' | 'defaultValue' | 'id' | 'name' | 'fieldProps' | 'fieldRef' | 'inputProps' | 'inputRef' | 'renderedValue'>;
|
|
4
|
-
export declare const SelectInputConsumer: FC<SelectInputConsumerProps>;
|
|
5
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SelectInputConsumer';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SelectInputConsumer';
|