@hh.ru/magritte-ui-input 7.0.8 → 7.1.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/BaseInput.d.ts +1 -1
- package/BaseInput.js +18 -8
- package/BaseInput.js.map +1 -1
- package/DateTimeInput.d.ts +7 -2
- package/DateTimeInput.js +21 -13
- package/DateTimeInput.js.map +1 -1
- package/Input.d.ts +1 -1
- package/NumberInput.d.ts +1 -1
- package/PasswordInput.d.ts +4 -2
- package/PasswordInput.js +5 -3
- package/PasswordInput.js.map +1 -1
- package/SearchInput.d.ts +1 -1
- package/SearchInput.js +3 -3
- package/SearchInput.js.map +1 -1
- package/UncontrolledDateTimeInput.d.ts +7 -2
- package/UncontrolledDateTimeInput.js +1 -1
- package/UncontrolledInput.d.ts +1 -1
- package/UncontrolledNumberInput.d.ts +1 -1
- package/UncontrolledPasswordInput.d.ts +4 -2
- package/UncontrolledSearchInput.d.ts +1 -1
- package/index.css +136 -105
- package/{index.esm-Dc5CZtKf.js → index.esm-J-67pHe5.js} +1 -1
- package/{index.esm-Dc5CZtKf.js.map → index.esm-J-67pHe5.js.map} +1 -1
- package/index.js +1 -1
- package/maskito-exports.js +1 -1
- package/package.json +4 -4
- package/types.d.ts +23 -27
- package/useDateTimeMask.js +1 -1
package/index.js
CHANGED
|
@@ -28,6 +28,6 @@ import './useFocus.js';
|
|
|
28
28
|
import '@hh.ru/magritte-ui-typography';
|
|
29
29
|
import '@hh.ru/magritte-common-number-formatter';
|
|
30
30
|
import './useDateTimeMask.js';
|
|
31
|
-
import './index.esm-
|
|
31
|
+
import './index.esm-J-67pHe5.js';
|
|
32
32
|
import './useUncontrolledInput.js';
|
|
33
33
|
//# sourceMappingURL=index.js.map
|
package/maskito-exports.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import './index.css';
|
|
2
|
-
export { M as MASKITO_DEFAULT_OPTIONS, m as maskitoDateOptionsGenerator, a as maskitoDateTimeOptionsGenerator, b as maskitoTimeOptionsGenerator, u as useMaskito } from './index.esm-
|
|
2
|
+
export { M as MASKITO_DEFAULT_OPTIONS, m as maskitoDateOptionsGenerator, a as maskitoDateTimeOptionsGenerator, b as maskitoTimeOptionsGenerator, u as useMaskito } from './index.esm-J-67pHe5.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
//# sourceMappingURL=maskito-exports.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-input",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"@hh.ru/magritte-common-use-disabled": "1.0.9",
|
|
32
32
|
"@hh.ru/magritte-common-use-multiple-refs": "1.1.4",
|
|
33
33
|
"@hh.ru/magritte-design-tokens": "20.0.1",
|
|
34
|
-
"@hh.ru/magritte-ui-action": "4.4.
|
|
34
|
+
"@hh.ru/magritte-ui-action": "4.4.18",
|
|
35
35
|
"@hh.ru/magritte-ui-breakpoint": "4.1.0",
|
|
36
36
|
"@hh.ru/magritte-ui-form-helper": "1.0.17",
|
|
37
|
-
"@hh.ru/magritte-ui-icon": "7.9.
|
|
37
|
+
"@hh.ru/magritte-ui-icon": "7.9.7",
|
|
38
38
|
"@hh.ru/magritte-ui-mock-component": "1.0.11",
|
|
39
39
|
"@hh.ru/magritte-ui-theme-provider": "1.1.33",
|
|
40
40
|
"@hh.ru/magritte-ui-typography": "3.0.22"
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "0cba1a0b8d618df338719bc996e2f5535af80e79"
|
|
51
51
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FocusEventHandler, ForwardedRef, MouseEventHandler, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { IconWrapperComponentSize24 } from '@hh.ru/magritte-ui-icon/iconTypes';
|
|
4
|
-
export type InputSize = 'medium' | 'large';
|
|
2
|
+
import type { FormatParams } from '@hh.ru/magritte-common-number-formatter';
|
|
3
|
+
import type { IconWrapperComponentSize16, IconWrapperComponentSize24 } from '@hh.ru/magritte-ui-icon/iconTypes';
|
|
4
|
+
export type InputSize = 'medium' | 'large' | 'small';
|
|
5
5
|
export interface InputFormatter {
|
|
6
6
|
/**
|
|
7
7
|
* @param prevValue - Значение до изменения
|
|
@@ -25,7 +25,7 @@ export interface ControlledProps {
|
|
|
25
25
|
value: string;
|
|
26
26
|
}
|
|
27
27
|
export type UncontrolledProps = Partial<ControlledProps>;
|
|
28
|
-
interface InputBaseProps {
|
|
28
|
+
export interface InputBaseProps {
|
|
29
29
|
/** Текст плейсхолдера */
|
|
30
30
|
placeholder?: ReactNode;
|
|
31
31
|
/** Постфикс */
|
|
@@ -50,66 +50,62 @@ interface InputBaseProps {
|
|
|
50
50
|
wrapperRef?: ForwardedRef<HTMLElement>;
|
|
51
51
|
/** Ограничение на количество введенных символов */
|
|
52
52
|
maxLength?: number;
|
|
53
|
-
}
|
|
54
|
-
interface LargeInputProps extends InputBaseProps {
|
|
55
53
|
/** Размер инпута */
|
|
56
|
-
size
|
|
57
|
-
/**
|
|
54
|
+
size?: InputSize;
|
|
55
|
+
/** Режим отображения плейсхолдера, применяется только в случае size=large */
|
|
58
56
|
elevatePlaceholder?: boolean;
|
|
59
57
|
}
|
|
60
|
-
export interface MediumInputProps extends InputBaseProps {
|
|
61
|
-
size?: 'medium';
|
|
62
|
-
elevatePlaceholder?: false;
|
|
63
|
-
}
|
|
64
58
|
type OnButtonClickType = MouseEventHandler<HTMLButtonElement>;
|
|
65
|
-
interface InputWithHintProps extends InputBaseProps {
|
|
59
|
+
export interface InputWithHintProps extends InputBaseProps {
|
|
66
60
|
/** Подсказка к полю ввода */
|
|
67
61
|
hint?: ReactNode;
|
|
68
62
|
/** Флаг показа подсказки при пустом значении инпута */
|
|
69
63
|
showHintAlways?: boolean;
|
|
70
64
|
}
|
|
71
|
-
|
|
65
|
+
type InputWithRightButtonProps = {
|
|
72
66
|
/** Флаг управляющий показом кнопки очистки ввода */
|
|
73
67
|
clearable?: never;
|
|
74
68
|
/** Флаг управляющий показом кнопки очистки ввода при фокусе */
|
|
75
69
|
clearableOnFocus?: never;
|
|
76
70
|
/** Иконка кнопки */
|
|
77
|
-
buttonIcon: IconWrapperComponentSize24;
|
|
71
|
+
buttonIcon: IconWrapperComponentSize16 | IconWrapperComponentSize24;
|
|
78
72
|
/** Обработчик события клика по кнопке */
|
|
79
73
|
onButtonClick: OnButtonClickType;
|
|
80
|
-
}
|
|
74
|
+
};
|
|
81
75
|
export interface InputWithoutRightButtonProps extends InputBaseProps {
|
|
82
76
|
clearable?: false;
|
|
83
77
|
clearableOnFocus?: false;
|
|
84
78
|
buttonIcon?: never;
|
|
85
79
|
onButtonClick?: never;
|
|
86
80
|
}
|
|
87
|
-
interface InputClearableProps extends InputBaseProps {
|
|
81
|
+
export interface InputClearableProps extends InputBaseProps {
|
|
88
82
|
clearable: true;
|
|
89
83
|
clearableOnFocus?: never;
|
|
90
84
|
buttonIcon?: never;
|
|
91
85
|
onButtonClick?: OnButtonClickType;
|
|
92
86
|
}
|
|
93
|
-
interface InputClearableOnFocusProps extends InputBaseProps {
|
|
87
|
+
export interface InputClearableOnFocusProps extends InputBaseProps {
|
|
94
88
|
clearable?: never;
|
|
95
89
|
clearableOnFocus: true;
|
|
96
90
|
buttonIcon?: never;
|
|
97
91
|
onButtonClick?: OnButtonClickType;
|
|
98
92
|
}
|
|
99
|
-
|
|
93
|
+
type InputWithRightButtonClearProps = InputClearableProps | InputClearableOnFocusProps;
|
|
100
94
|
interface InputWithInputIconProps extends InputBaseProps {
|
|
101
|
-
inputIcon?: IconWrapperComponentSize24;
|
|
95
|
+
inputIcon?: IconWrapperComponentSize16 | IconWrapperComponentSize24;
|
|
102
96
|
}
|
|
103
|
-
interface InputWithFixedPlaceholderProps extends InputBaseProps {
|
|
104
|
-
/**
|
|
97
|
+
export interface InputWithFixedPlaceholderProps extends InputBaseProps {
|
|
98
|
+
/**
|
|
99
|
+
* Фиксированный placeholder: отображается по мере ввода в input и обрезается на длину введённого значения.
|
|
100
|
+
* Обычно применяется для input-ов с маской: дата/время, номер телефона или банковской карты и т.д.
|
|
101
|
+
* */
|
|
105
102
|
fixedPlaceholder?: string;
|
|
106
103
|
}
|
|
107
|
-
type
|
|
108
|
-
|
|
109
|
-
type InputProps = NoButtonInputProps & InputWithHintProps & (InputWithRightButtonProps | InputWithoutRightButtonProps | InputWithRightButtonClearProps);
|
|
104
|
+
export type BaseInputProps = InputBaseProps & (InputWithRightButtonProps | InputWithoutRightButtonProps | InputWithRightButtonClearProps) & InputWithInputIconProps & InputWithFixedPlaceholderProps & InputWithHintProps & ControlledProps;
|
|
105
|
+
type InputProps = InputBaseProps & InputWithHintProps & (InputWithRightButtonProps | InputWithoutRightButtonProps | InputWithRightButtonClearProps);
|
|
110
106
|
export type ControlledInputProps = InputProps & ControlledProps;
|
|
111
107
|
export type UncontrolledInputProps = InputProps & UncontrolledProps;
|
|
112
|
-
type PasswordInputProps =
|
|
108
|
+
type PasswordInputProps = InputBaseProps & InputWithHintProps & {
|
|
113
109
|
type?: never;
|
|
114
110
|
clearable?: never;
|
|
115
111
|
};
|
|
@@ -133,7 +129,7 @@ export type ControlledSearchInputProps = SearchInputProps & ControlledProps;
|
|
|
133
129
|
export type UncontrolledSearchInputProps = SearchInputProps & UncontrolledProps;
|
|
134
130
|
export type DateInputMask = 'dd' | 'mm.yyyy' | 'dd.mm.yyyy';
|
|
135
131
|
export type TimeInputRounding = 5 | 15 | 30 | 60;
|
|
136
|
-
export type DateTimeInputProps =
|
|
132
|
+
export type DateTimeInputProps = InputBaseProps & {
|
|
137
133
|
/** Формат заполнения даты */
|
|
138
134
|
dateMask?: DateInputMask;
|
|
139
135
|
/** Флаг для включения режима ввода времени */
|
package/useDateTimeMask.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import { M as MASKITO_DEFAULT_OPTIONS, a as maskitoDateTimeOptionsGenerator, m as maskitoDateOptionsGenerator, b as maskitoTimeOptionsGenerator, u as useMaskito } from './index.esm-
|
|
3
|
+
import { M as MASKITO_DEFAULT_OPTIONS, a as maskitoDateTimeOptionsGenerator, m as maskitoDateOptionsGenerator, b as maskitoTimeOptionsGenerator, u as useMaskito } from './index.esm-J-67pHe5.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Округление времени (в формате 00:00) до ближайшего заданного шага
|