@skbkontur/react-ui 4.25.0 → 4.25.1-MaskedInput-fix.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/CHANGELOG.md +8 -0
- package/LICENSE +21 -21
- package/cjs/components/Gapped/Gapped.md +43 -43
- package/cjs/components/Input/Input.d.ts +3 -2
- package/cjs/components/Input/Input.js +7 -4
- package/cjs/components/Input/Input.js.map +1 -1
- package/cjs/components/MaskedInput/MaskedInput.d.ts +22 -4
- package/cjs/components/MaskedInput/MaskedInput.helpers.d.ts +10 -0
- package/cjs/components/MaskedInput/MaskedInput.helpers.js +30 -0
- package/cjs/components/MaskedInput/MaskedInput.helpers.js.map +1 -0
- package/cjs/components/MaskedInput/MaskedInput.js +181 -20
- package/cjs/components/MaskedInput/MaskedInput.js.map +1 -1
- package/cjs/components/MaskedInput/MaskedInput.md +203 -9
- package/cjs/components/MaskedInput/MaskedInput.styles.d.ts +3 -0
- package/cjs/components/MaskedInput/MaskedInput.styles.js +4 -0
- package/cjs/components/MaskedInput/MaskedInput.styles.js.map +1 -0
- package/cjs/components/RadioGroup/RadioGroup.md +43 -43
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +3 -0
- package/cjs/index.js.map +1 -1
- package/cjs/internal/MaskedInputElement/MaskedInputElement.d.ts +6 -9
- package/cjs/internal/MaskedInputElement/MaskedInputElement.js +99 -129
- package/cjs/internal/MaskedInputElement/MaskedInputElement.js.map +1 -1
- package/cjs/internal/MaskedInputElement/MaskedInputElement.styles.d.ts +2 -3
- package/cjs/internal/MaskedInputElement/MaskedInputElement.styles.js +7 -17
- package/cjs/internal/MaskedInputElement/MaskedInputElement.styles.js.map +1 -1
- package/cjs/internal/ThemeShowcase/ThemeShowcase.md +13 -13
- package/cjs/lib/styles/HoldSelectionColor.js +1 -1
- package/cjs/lib/styles/HoldSelectionColor.js.map +1 -1
- package/cjs/lib/styles/UiFont.d.ts +4 -0
- package/cjs/lib/styles/UiFont.js +39 -0
- package/cjs/lib/styles/UiFont.js.map +1 -0
- package/components/Gapped/Gapped.md +43 -43
- package/components/Input/Input/Input.js +8 -4
- package/components/Input/Input/Input.js.map +1 -1
- package/components/Input/Input.d.ts +3 -2
- package/components/MaskedInput/MaskedInput/MaskedInput.js +163 -22
- package/components/MaskedInput/MaskedInput/MaskedInput.js.map +1 -1
- package/components/MaskedInput/MaskedInput.d.ts +22 -4
- package/components/MaskedInput/MaskedInput.helpers/MaskedInput.helpers.js +27 -0
- package/components/MaskedInput/MaskedInput.helpers/MaskedInput.helpers.js.map +1 -0
- package/components/MaskedInput/MaskedInput.helpers/package.json +6 -0
- package/components/MaskedInput/MaskedInput.helpers.d.ts +10 -0
- package/components/MaskedInput/MaskedInput.md +203 -9
- package/components/MaskedInput/MaskedInput.styles/MaskedInput.styles.js +4 -0
- package/components/MaskedInput/MaskedInput.styles/MaskedInput.styles.js.map +1 -0
- package/components/MaskedInput/MaskedInput.styles/package.json +6 -0
- package/components/MaskedInput/MaskedInput.styles.d.ts +3 -0
- package/components/RadioGroup/RadioGroup.md +43 -43
- package/index.d.ts +3 -0
- package/index.js +3 -0
- package/index.js.map +1 -1
- package/internal/MaskedInputElement/MaskedInputElement/MaskedInputElement.js +102 -161
- package/internal/MaskedInputElement/MaskedInputElement/MaskedInputElement.js.map +1 -1
- package/internal/MaskedInputElement/MaskedInputElement.d.ts +6 -9
- package/internal/MaskedInputElement/MaskedInputElement.styles/MaskedInputElement.styles.js +5 -8
- package/internal/MaskedInputElement/MaskedInputElement.styles/MaskedInputElement.styles.js.map +1 -1
- package/internal/MaskedInputElement/MaskedInputElement.styles.d.ts +2 -3
- package/internal/ThemeShowcase/ThemeShowcase.md +13 -13
- package/lib/styles/HoldSelectionColor/HoldSelectionColor.js +1 -1
- package/lib/styles/HoldSelectionColor/HoldSelectionColor.js.map +1 -1
- package/lib/styles/UiFont/UiFont.js +30 -0
- package/lib/styles/UiFont/UiFont.js.map +1 -0
- package/lib/styles/UiFont/package.json +6 -0
- package/lib/styles/UiFont.d.ts +4 -0
- package/package.json +2 -5
- package/cjs/internal/MaskedInputElement/MaskedInputElement.helpers.d.ts +0 -16
- package/cjs/internal/MaskedInputElement/MaskedInputElement.helpers.js +0 -52
- package/cjs/internal/MaskedInputElement/MaskedInputElement.helpers.js.map +0 -1
- package/internal/MaskedInputElement/MaskedInputElement.helpers/MaskedInputElement.helpers.js +0 -43
- package/internal/MaskedInputElement/MaskedInputElement.helpers/MaskedInputElement.helpers.js.map +0 -1
- package/internal/MaskedInputElement/MaskedInputElement.helpers/package.json +0 -6
- package/internal/MaskedInputElement/MaskedInputElement.helpers.d.ts +0 -16
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputMask, MaskedPatternOptions } from 'imask';
|
|
2
|
+
import { IMaskInputProps } from 'react-imask';
|
|
2
3
|
import { Nullable } from '../../typings/utility-types';
|
|
4
|
+
import { Input, InputProps, InputType } from '../Input';
|
|
3
5
|
export interface MaskedProps {
|
|
4
6
|
/** Паттерн маски */
|
|
5
7
|
mask: string;
|
|
@@ -10,11 +12,27 @@ export interface MaskedProps {
|
|
|
10
12
|
* @default { '9': '[0-9]', 'a': '[A-Za-z]', '*': '[A-Za-z0-9]' }
|
|
11
13
|
*/
|
|
12
14
|
formatChars?: Record<string, string>;
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Показывать символы маски
|
|
17
|
+
*
|
|
18
|
+
* null - не показывать
|
|
19
|
+
* true - показывать всегда
|
|
20
|
+
* false - показывать по фокусу
|
|
21
|
+
*/
|
|
22
|
+
alwaysShowMask?: boolean | null;
|
|
23
|
+
/**
|
|
24
|
+
* Пропы для компонента `IMaskInput`
|
|
25
|
+
*
|
|
26
|
+
* @see https://imask.js.org/guide.html
|
|
27
|
+
*/
|
|
28
|
+
imaskProps?: IMaskInputProps<HTMLInputElement>;
|
|
15
29
|
}
|
|
16
30
|
export declare type MaskInputType = Exclude<InputType, 'number' | 'date' | 'time' | 'password'>;
|
|
17
|
-
export interface
|
|
31
|
+
export interface IMaskRefType {
|
|
32
|
+
maskRef: InputMask<MaskedPatternOptions>;
|
|
33
|
+
element: HTMLInputElement;
|
|
34
|
+
}
|
|
35
|
+
export interface MaskedInputProps extends MaskedProps, Omit<InputProps, 'mask' | 'maxLength' | 'type' | 'alwaysShowMask'> {
|
|
18
36
|
type?: MaskInputType;
|
|
19
37
|
}
|
|
20
38
|
/**
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { isNonNullable } from "../../../lib/utils";
|
|
2
|
+
export var DEFAULT_MASK_CHAR = '_';
|
|
3
|
+
export var DEFINITIONS = Object.freeze({
|
|
4
|
+
'9': /[0-9]/,
|
|
5
|
+
a: /[A-Za-z]/,
|
|
6
|
+
'*': /[A-Za-z0-9]/
|
|
7
|
+
});
|
|
8
|
+
export function getDefinitions(formatChars) {
|
|
9
|
+
if (isNonNullable(formatChars)) {
|
|
10
|
+
var chars = {};
|
|
11
|
+
|
|
12
|
+
for (var key in formatChars) {
|
|
13
|
+
chars[key] = new RegExp(formatChars[key]);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return chars;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return DEFINITIONS;
|
|
20
|
+
}
|
|
21
|
+
export function getMaskChar(maskChar) {
|
|
22
|
+
if (maskChar === null) {
|
|
23
|
+
return '';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return maskChar === undefined ? DEFAULT_MASK_CHAR : maskChar;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["MaskedInput.helpers.ts"],"names":["isNonNullable","DEFAULT_MASK_CHAR","DEFINITIONS","Object","freeze","a","getDefinitions","formatChars","chars","key","RegExp","getMaskChar","maskChar","undefined"],"mappings":";;AAEA,SAASA,aAAT,QAA8B,iBAA9B;;;;AAIA,OAAO,IAAMC,iBAAiB,GAAG,GAA1B;AACP,OAAO,IAAMC,WAAW,GAAGC,MAAM,CAACC,MAAP,CAAc,EAAE,KAAK,OAAP,EAAgBC,CAAC,EAAE,UAAnB,EAA+B,KAAK,aAApC,EAAd,CAApB;;AAEP,OAAO,SAASC,cAAT,CAAwBC,WAAxB,EAAsF;AAC3F,MAAIP,aAAa,CAACO,WAAD,CAAjB,EAAgC;AAC9B,QAAMC,KAA6B,GAAG,EAAtC;;AAEA,SAAK,IAAMC,GAAX,IAAkBF,WAAlB,EAA+B;AAC7BC,MAAAA,KAAK,CAACC,GAAD,CAAL,GAAa,IAAIC,MAAJ,CAAWH,WAAW,CAACE,GAAD,CAAtB,CAAb;AACD;;AAED,WAAOD,KAAP;AACD;;AAED,SAAON,WAAP;AACD;;AAED,OAAO,SAASS,WAAT,CAAqBC,QAArB,EAAkE;AACvE,MAAIA,QAAQ,KAAK,IAAjB,EAAuB;AACrB,WAAO,EAAP;AACD;;AAED,SAAOA,QAAQ,KAAKC,SAAb,GAAyBZ,iBAAzB,GAA6CW,QAApD;AACD","sourcesContent":["import IMask, { Definitions } from 'imask';\n\nimport { isNonNullable } from '../../lib/utils';\n\nexport type AnyIMaskType = ReturnType<typeof IMask.createMask>;\n\nexport const DEFAULT_MASK_CHAR = '_';\nexport const DEFINITIONS = Object.freeze({ '9': /[0-9]/, a: /[A-Za-z]/, '*': /[A-Za-z0-9]/ });\n\nexport function getDefinitions(formatChars: Record<string, string> | undefined): Definitions {\n if (isNonNullable(formatChars)) {\n const chars: Record<string, RegExp> = {};\n\n for (const key in formatChars) {\n chars[key] = new RegExp(formatChars[key]);\n }\n\n return chars;\n }\n\n return DEFINITIONS;\n}\n\nexport function getMaskChar(maskChar: string | null | undefined): string {\n if (maskChar === null) {\n return '';\n }\n\n return maskChar === undefined ? DEFAULT_MASK_CHAR : maskChar;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import IMask, { Definitions } from 'imask';
|
|
2
|
+
export declare type AnyIMaskType = ReturnType<typeof IMask.createMask>;
|
|
3
|
+
export declare const DEFAULT_MASK_CHAR = "_";
|
|
4
|
+
export declare const DEFINITIONS: Readonly<{
|
|
5
|
+
'9': RegExp;
|
|
6
|
+
a: RegExp;
|
|
7
|
+
'*': RegExp;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function getDefinitions(formatChars: Record<string, string> | undefined): Definitions;
|
|
10
|
+
export declare function getMaskChar(maskChar: string | null | undefined): string;
|
|
@@ -1,21 +1,215 @@
|
|
|
1
|
+
#### `mask`
|
|
2
|
+
|
|
3
|
+
Маска телефона
|
|
4
|
+
|
|
5
|
+
```jsx harmony
|
|
6
|
+
import { Input } from '@skbkontur/react-ui';
|
|
7
|
+
|
|
8
|
+
const [value, setValue] = React.useState('123');
|
|
9
|
+
|
|
10
|
+
const listeners = {
|
|
11
|
+
...[
|
|
12
|
+
'onKeyPress',
|
|
13
|
+
'onKeyDown',
|
|
14
|
+
'onFocus',
|
|
15
|
+
'onBlur',
|
|
16
|
+
'onInput',
|
|
17
|
+
'onChange',
|
|
18
|
+
'onCut',
|
|
19
|
+
].reduce((list, item) => ({ ...list, [item]: (e) => console.log(item, e) }), {})
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
<>
|
|
23
|
+
<MaskedInput
|
|
24
|
+
mask="+7 999-999-99-99"
|
|
25
|
+
alwaysShowMask
|
|
26
|
+
value={value}
|
|
27
|
+
onValueChange={setValue}
|
|
28
|
+
{...listeners}
|
|
29
|
+
/>
|
|
30
|
+
<Input
|
|
31
|
+
mask="+7 999-999-99-99"
|
|
32
|
+
alwaysShowMask
|
|
33
|
+
value={value}
|
|
34
|
+
onValueChange={setValue}
|
|
35
|
+
{...listeners}
|
|
36
|
+
/>
|
|
37
|
+
<Input
|
|
38
|
+
value={value}
|
|
39
|
+
onValueChange={setValue}
|
|
40
|
+
{...listeners}
|
|
41
|
+
/>
|
|
42
|
+
</>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### `maskChar`
|
|
46
|
+
|
|
47
|
+
может изменить символ значения с маской
|
|
48
|
+
|
|
49
|
+
```jsx harmony
|
|
50
|
+
<MaskedInput
|
|
51
|
+
mask="9999 9999 9999 9999"
|
|
52
|
+
maskChar="X"
|
|
53
|
+
placeholder="Номер карты"
|
|
54
|
+
alwaysShowMask
|
|
55
|
+
/>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### `formatChars`
|
|
59
|
+
|
|
60
|
+
При необходимости можно настроить собственный словарь.
|
|
61
|
+
|
|
62
|
+
Возможности `imaskProps.blocks` намного шире. Смотрите пример ниже.
|
|
63
|
+
|
|
64
|
+
```jsx harmony
|
|
65
|
+
const [value, setValue] = React.useState('');
|
|
66
|
+
|
|
67
|
+
<MaskedInput
|
|
68
|
+
mask="Hh:Mm:Ss"
|
|
69
|
+
alwaysShowMask
|
|
70
|
+
formatChars={{
|
|
71
|
+
H: '[0-2]',
|
|
72
|
+
h: value.startsWith('2') ? '[0-3]' : '[0-9]',
|
|
73
|
+
M: '[0-5]',
|
|
74
|
+
m: '[0-9]',
|
|
75
|
+
S: '[0-5]',
|
|
76
|
+
s: '[0-9]',
|
|
77
|
+
}}
|
|
78
|
+
value={value}
|
|
79
|
+
onValueChange={setValue}
|
|
80
|
+
/>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### `alwaysShowMask`
|
|
84
|
+
|
|
85
|
+
Показывает маску всегда. Placeholder в этом случае игнорируется. Логика немного отличается от старой реализации, из-за
|
|
86
|
+
специфики iMask. Раньше маска обязательно появлялась при фокусе, но теперь чтобы маску было видно надо явно задать этот
|
|
87
|
+
проп.
|
|
88
|
+
|
|
89
|
+
```jsx harmony
|
|
90
|
+
<MaskedInput mask="+7 (999) 999-99-99" alwaysShowMask placeholder="Номер телефона" />
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### `imaskProps`*
|
|
94
|
+
|
|
95
|
+
Переопределяет пропы iMask.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
Контрол используется внутри пакет [iMask](https://imask.js.org/). Пропы `mask`, `maskChar` и `formatChars` прокидываются
|
|
100
|
+
с необходимыми доработками. Также для обратной совместимости со старым поведением добавляется несколько других пропов.
|
|
101
|
+
|
|
102
|
+
Обратите внимание, что в `definitions` попадает **`0: /\d/`**. Это дефолтное поле, которое нельзя удалить. Но в старой
|
|
103
|
+
реализации `0` считался фиксированным символом, из-за чего приходится немного редактировать маску.
|
|
104
|
+
|
|
105
|
+
Конвертация пропов выглядит примерно так:
|
|
106
|
+
|
|
107
|
+
```typescript static
|
|
108
|
+
mask: mask.replace(/0/g, '{\\0}'),
|
|
109
|
+
placeholderChar: props.maskChar || '_',
|
|
110
|
+
definitions: props.formatChars || { '9': /[0-9]/, a: /[A-Za-z]/, '*': /[A-Za-z0-9]/ },
|
|
111
|
+
eager: true,
|
|
112
|
+
overwrite: 'shift',
|
|
113
|
+
lazy: !alwaysShowMask,
|
|
114
|
+
...props.imaskProps,
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
##### `imaskProps.unmask`
|
|
120
|
+
|
|
121
|
+
Можно сразу получать value без фиксированных символов маски
|
|
122
|
+
|
|
1
123
|
```jsx harmony
|
|
2
|
-
|
|
124
|
+
const [value, setValue] = React.useState('');
|
|
125
|
+
|
|
126
|
+
<>
|
|
127
|
+
<span>unmask value: {value}</span>
|
|
128
|
+
<br />
|
|
129
|
+
<MaskedInput
|
|
130
|
+
mask="+7 (999) 999-99-99"
|
|
131
|
+
imaskProps={{
|
|
132
|
+
unmask: true
|
|
133
|
+
}}
|
|
134
|
+
alwaysShowMask
|
|
135
|
+
value={value}
|
|
136
|
+
onValueChange={setValue}
|
|
137
|
+
/>
|
|
138
|
+
</>
|
|
3
139
|
```
|
|
4
140
|
|
|
5
|
-
|
|
141
|
+
##### `imaskProps.mask []`
|
|
142
|
+
|
|
143
|
+
Опциональные части маски
|
|
144
|
+
|
|
6
145
|
```jsx harmony
|
|
7
|
-
|
|
146
|
+
const [value, setValue] = React.useState('');
|
|
147
|
+
const [complete, setComplete] = React.useState(false);
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
<MaskedInput
|
|
151
|
+
mask="99-999999[99]-99"
|
|
152
|
+
alwaysShowMask
|
|
153
|
+
rightIcon={complete ? '✅' : '⬜'}
|
|
154
|
+
imaskProps={{
|
|
155
|
+
onAccept: (v, imask) => {
|
|
156
|
+
setValue(v);
|
|
157
|
+
setComplete(imask.masked.isComplete);
|
|
158
|
+
}
|
|
159
|
+
}}
|
|
160
|
+
/>
|
|
8
161
|
```
|
|
9
162
|
|
|
10
|
-
|
|
163
|
+
##### `imaskProps.mask {}`
|
|
164
|
+
|
|
165
|
+
Фиксированные части маски, которые попадут в `value` при `unmask = true`. Любой невалидный символ (например`пробел`)
|
|
166
|
+
переведёт каретку за фиксированный символ.
|
|
167
|
+
|
|
11
168
|
```jsx harmony
|
|
12
|
-
|
|
169
|
+
const [value, setValue] = React.useState('');
|
|
170
|
+
const [complete, setComplete] = React.useState(false);
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
<>
|
|
174
|
+
<span>unmask value: {value}</span>
|
|
175
|
+
<br />
|
|
176
|
+
<MaskedInput
|
|
177
|
+
mask="aa[aaaaaaaaaaaaaaaaa]{@}aa[aaaaaaaaaaaaaaaaa]{\.}aa[aaaa]"
|
|
178
|
+
alwaysShowMask
|
|
179
|
+
rightIcon={complete ? '✅' : '⬜'}
|
|
180
|
+
imaskProps={{
|
|
181
|
+
unmask: true,
|
|
182
|
+
onAccept: (v, imask) => {
|
|
183
|
+
setValue(v);
|
|
184
|
+
setComplete(imask.masked.isComplete);
|
|
185
|
+
}
|
|
186
|
+
}}
|
|
187
|
+
/>
|
|
188
|
+
</>
|
|
13
189
|
```
|
|
14
190
|
|
|
15
|
-
|
|
191
|
+
##### `imaskProps.blocks`
|
|
16
192
|
|
|
17
|
-
|
|
193
|
+
Пример маски времени. Нажмите цифру `6`, чтобы сработало автозаполнение.
|
|
18
194
|
|
|
19
|
-
|
|
195
|
+
```jsx harmony
|
|
196
|
+
import IMask from 'imask';
|
|
197
|
+
|
|
198
|
+
const block = {
|
|
199
|
+
mask: IMask.MaskedRange,
|
|
200
|
+
from: 0,
|
|
201
|
+
autofix: 'pad',
|
|
202
|
+
};
|
|
20
203
|
|
|
21
|
-
|
|
204
|
+
<MaskedInput
|
|
205
|
+
mask="HH:MM:SS"
|
|
206
|
+
imaskProps={{
|
|
207
|
+
blocks: {
|
|
208
|
+
HH: { ...block, to: 23, },
|
|
209
|
+
MM: { ...block, to: 59, },
|
|
210
|
+
SS: { ...block, to: 59, },
|
|
211
|
+
}
|
|
212
|
+
}}
|
|
213
|
+
alwaysShowMask
|
|
214
|
+
/>
|
|
215
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["MaskedInput.styles.ts"],"names":["prefix","globalClasses","root"],"mappings":"AAAA,SAASA,MAAT,QAAuB,2BAAvB;;AAEA,OAAO,IAAMC,aAAa,GAAGD,MAAM,CAAC,cAAD,CAAN,CAAuB;AAClDE,EAAAA,IAAI,EAAE,MAD4C,EAAvB,CAAtB","sourcesContent":["import { prefix } from '../../lib/theming/Emotion';\n\nexport const globalClasses = prefix('masked-input')({\n root: 'root',\n});\n"]}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
```jsx harmony
|
|
2
|
-
import { Gapped, Radio } from '@skbkontur/react-ui';
|
|
3
|
-
|
|
4
|
-
let items = ['One', 'Two', 'Three', 'Four'];
|
|
5
|
-
|
|
6
|
-
let simpleRadioGroup = (
|
|
7
|
-
<div>
|
|
8
|
-
<h2>Numbers</h2>
|
|
9
|
-
<RadioGroup name="number-simple" items={items} defaultValue="One" />
|
|
10
|
-
</div>
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
let complexRadioGroup = (
|
|
14
|
-
<div>
|
|
15
|
-
<h2>Numbers</h2>
|
|
16
|
-
<RadioGroup name="number-complex" defaultValue="3">
|
|
17
|
-
<Gapped gap={40}>
|
|
18
|
-
<Gapped vertical gap={0}>
|
|
19
|
-
<b>Odd</b>
|
|
20
|
-
<Radio value="1">One</Radio>
|
|
21
|
-
<Radio value="3">Three</Radio>
|
|
22
|
-
<Radio value="5" disabled>
|
|
23
|
-
Five
|
|
24
|
-
</Radio>
|
|
25
|
-
<Radio value="7">Seven</Radio>
|
|
26
|
-
</Gapped>
|
|
27
|
-
<Gapped vertical gap={0}>
|
|
28
|
-
<b>Even</b>
|
|
29
|
-
<Radio value="2">Two</Radio>
|
|
30
|
-
<Radio value="4">Four</Radio>
|
|
31
|
-
<Radio value="6">Six</Radio>
|
|
32
|
-
<Radio value="8">Eight</Radio>
|
|
33
|
-
</Gapped>
|
|
34
|
-
</Gapped>
|
|
35
|
-
</RadioGroup>
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
<div>
|
|
40
|
-
{simpleRadioGroup}
|
|
41
|
-
{complexRadioGroup}
|
|
42
|
-
</div>;
|
|
43
|
-
```
|
|
1
|
+
```jsx harmony
|
|
2
|
+
import { Gapped, Radio } from '@skbkontur/react-ui';
|
|
3
|
+
|
|
4
|
+
let items = ['One', 'Two', 'Three', 'Four'];
|
|
5
|
+
|
|
6
|
+
let simpleRadioGroup = (
|
|
7
|
+
<div>
|
|
8
|
+
<h2>Numbers</h2>
|
|
9
|
+
<RadioGroup name="number-simple" items={items} defaultValue="One" />
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
let complexRadioGroup = (
|
|
14
|
+
<div>
|
|
15
|
+
<h2>Numbers</h2>
|
|
16
|
+
<RadioGroup name="number-complex" defaultValue="3">
|
|
17
|
+
<Gapped gap={40}>
|
|
18
|
+
<Gapped vertical gap={0}>
|
|
19
|
+
<b>Odd</b>
|
|
20
|
+
<Radio value="1">One</Radio>
|
|
21
|
+
<Radio value="3">Three</Radio>
|
|
22
|
+
<Radio value="5" disabled>
|
|
23
|
+
Five
|
|
24
|
+
</Radio>
|
|
25
|
+
<Radio value="7">Seven</Radio>
|
|
26
|
+
</Gapped>
|
|
27
|
+
<Gapped vertical gap={0}>
|
|
28
|
+
<b>Even</b>
|
|
29
|
+
<Radio value="2">Two</Radio>
|
|
30
|
+
<Radio value="4">Four</Radio>
|
|
31
|
+
<Radio value="6">Six</Radio>
|
|
32
|
+
<Radio value="8">Eight</Radio>
|
|
33
|
+
</Gapped>
|
|
34
|
+
</Gapped>
|
|
35
|
+
</RadioGroup>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
<div>
|
|
40
|
+
{simpleRadioGroup}
|
|
41
|
+
{complexRadioGroup}
|
|
42
|
+
</div>;
|
|
43
|
+
```
|
package/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export * from './components/TokenInput';
|
|
|
45
45
|
export * from './components/Tooltip';
|
|
46
46
|
export * from './components/TooltipMenu';
|
|
47
47
|
export * from './components/ResponsiveLayout';
|
|
48
|
+
export * from './components/MaskedInput';
|
|
48
49
|
export * from './lib/featureFlagsContext';
|
|
49
50
|
export * from './lib/locale';
|
|
50
51
|
export * from './lib/theming/ThemeContext';
|
|
@@ -55,6 +56,8 @@ export * from './lib/theming/themes/DefaultTheme8pxOld';
|
|
|
55
56
|
export * from './lib/theming/themes/FlatTheme8pxOld';
|
|
56
57
|
export * from './lib/theming/themes/Theme2022';
|
|
57
58
|
export * from './lib/theming/themes/Theme2022Dark';
|
|
59
|
+
export * from './lib/theming/themes/Theme2022Update2024';
|
|
60
|
+
export * from './lib/theming/themes/Theme2022DarkUpdate2024';
|
|
58
61
|
export * from './lib/types/props';
|
|
59
62
|
export * from './internal/Popup/types';
|
|
60
63
|
export * as ColorFunctions from './lib/styles/ColorFunctions';
|
package/index.js
CHANGED
|
@@ -45,6 +45,7 @@ export * from './components/TokenInput';
|
|
|
45
45
|
export * from './components/Tooltip';
|
|
46
46
|
export * from './components/TooltipMenu';
|
|
47
47
|
export * from './components/ResponsiveLayout';
|
|
48
|
+
export * from './components/MaskedInput';
|
|
48
49
|
export * from './lib/featureFlagsContext';
|
|
49
50
|
export * from './lib/locale';
|
|
50
51
|
export * from './lib/theming/ThemeContext';
|
|
@@ -55,6 +56,8 @@ export * from './lib/theming/themes/DefaultTheme8pxOld';
|
|
|
55
56
|
export * from './lib/theming/themes/FlatTheme8pxOld';
|
|
56
57
|
export * from './lib/theming/themes/Theme2022';
|
|
57
58
|
export * from './lib/theming/themes/Theme2022Dark';
|
|
59
|
+
export * from './lib/theming/themes/Theme2022Update2024';
|
|
60
|
+
export * from './lib/theming/themes/Theme2022DarkUpdate2024';
|
|
58
61
|
export * from './lib/types/props';
|
|
59
62
|
export * from './internal/Popup/types';import * as _ColorFunctions from
|
|
60
63
|
'./lib/styles/ColorFunctions';export { _ColorFunctions as ColorFunctions };import * as _DimensionFunctions from
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["ColorFunctions","DimensionFunctions"],"mappings":"AAAA,cAAc,2BAAd;AACA,cAAc,qBAAd;AACA,cAAc,uBAAd;AACA,cAAc,qBAAd;AACA,cAAc,uBAAd;AACA,cAAc,uBAAd;AACA,cAAc,4BAAd;AACA,cAAc,4BAAd;AACA,cAAc,wBAAd;AACA,cAAc,yBAAd;AACA,cAAc,uBAAd;AACA,cAAc,2BAAd;AACA,cAAc,2BAAd;AACA,cAAc,sBAAd;AACA,cAAc,qBAAd;AACA,cAAc,2BAAd;AACA,cAAc,oBAAd;AACA,cAAc,mBAAd;AACA,cAAc,oBAAd;AACA,cAAc,oBAAd;AACA,cAAc,mBAAd;AACA,cAAc,qBAAd;AACA,cAAc,yBAAd;AACA,cAAc,uBAAd;AACA,cAAc,4BAAd;AACA,cAAc,wBAAd;AACA,cAAc,oBAAd;AACA,cAAc,qBAAd;AACA,cAAc,4BAAd;AACA,cAAc,oBAAd;AACA,cAAc,yBAAd;AACA,cAAc,8BAAd;AACA,cAAc,qBAAd;AACA,cAAc,uBAAd;AACA,cAAc,sBAAd;AACA,cAAc,qBAAd;AACA,cAAc,uBAAd;AACA,cAAc,mBAAd;AACA,cAAc,uBAAd;AACA,cAAc,oBAAd;AACA,cAAc,0BAAd;AACA,cAAc,qBAAd;AACA,cAAc,oBAAd;AACA,cAAc,yBAAd;AACA,cAAc,sBAAd;AACA,cAAc,0BAAd;AACA,cAAc,+BAAd;AACA,cAAc,2BAAd;AACA,cAAc,cAAd;AACA,cAAc,4BAAd;AACA,cAAc,4BAAd;AACA,cAAc,mCAAd;AACA,cAAc,gCAAd;AACA,cAAc,yCAAd;AACA,cAAc,sCAAd;AACA,cAAc,gCAAd;AACA,cAAc,oCAAd;AACA,cAAc,mBAAd;AACA,cAAc,wBAAd,C;AACgC,6B,6BAApBA,c;AACwB,iC,iCAAxBC,kB","sourcesContent":["export * from './components/Autocomplete';\nexport * from './components/Button';\nexport * from './components/Calendar';\nexport * from './components/Center';\nexport * from './components/Checkbox';\nexport * from './components/ComboBox';\nexport * from './components/CurrencyInput';\nexport * from './components/CurrencyLabel';\nexport * from './components/DateInput';\nexport * from './components/DatePicker';\nexport * from './components/Dropdown';\nexport * from './components/DropdownMenu';\nexport * from './components/FileUploader';\nexport * from './components/FxInput';\nexport * from './components/Gapped';\nexport * from './components/GlobalLoader';\nexport * from './components/Group';\nexport * from './components/Hint';\nexport * from './components/Input';\nexport * from './components/Kebab';\nexport * from './components/Link';\nexport * from './components/Loader';\nexport * from './components/MenuHeader';\nexport * from './components/MenuItem';\nexport * from './components/MenuSeparator';\nexport * from './components/MiniModal';\nexport * from './components/Modal';\nexport * from './components/Paging';\nexport * from './components/PasswordInput';\nexport * from './components/Radio';\nexport * from './components/RadioGroup';\nexport * from './components/ScrollContainer';\nexport * from './components/Select';\nexport * from './components/SidePage';\nexport * from './components/Spinner';\nexport * from './components/Sticky';\nexport * from './components/Switcher';\nexport * from './components/Tabs';\nexport * from './components/Textarea';\nexport * from './components/Toast';\nexport * from './components/SingleToast';\nexport * from './components/Toggle';\nexport * from './components/Token';\nexport * from './components/TokenInput';\nexport * from './components/Tooltip';\nexport * from './components/TooltipMenu';\nexport * from './components/ResponsiveLayout';\nexport * from './lib/featureFlagsContext';\nexport * from './lib/locale';\nexport * from './lib/theming/ThemeContext';\nexport * from './lib/theming/ThemeFactory';\nexport * from './lib/theming/themes/DefaultTheme';\nexport * from './lib/theming/themes/DarkTheme';\nexport * from './lib/theming/themes/DefaultTheme8pxOld';\nexport * from './lib/theming/themes/FlatTheme8pxOld';\nexport * from './lib/theming/themes/Theme2022';\nexport * from './lib/theming/themes/Theme2022Dark';\nexport * from './lib/types/props';\nexport * from './internal/Popup/types';\nexport * as ColorFunctions from './lib/styles/ColorFunctions';\nexport * as DimensionFunctions from './lib/styles/DimensionFunctions';\n"]}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["ColorFunctions","DimensionFunctions"],"mappings":"AAAA,cAAc,2BAAd;AACA,cAAc,qBAAd;AACA,cAAc,uBAAd;AACA,cAAc,qBAAd;AACA,cAAc,uBAAd;AACA,cAAc,uBAAd;AACA,cAAc,4BAAd;AACA,cAAc,4BAAd;AACA,cAAc,wBAAd;AACA,cAAc,yBAAd;AACA,cAAc,uBAAd;AACA,cAAc,2BAAd;AACA,cAAc,2BAAd;AACA,cAAc,sBAAd;AACA,cAAc,qBAAd;AACA,cAAc,2BAAd;AACA,cAAc,oBAAd;AACA,cAAc,mBAAd;AACA,cAAc,oBAAd;AACA,cAAc,oBAAd;AACA,cAAc,mBAAd;AACA,cAAc,qBAAd;AACA,cAAc,yBAAd;AACA,cAAc,uBAAd;AACA,cAAc,4BAAd;AACA,cAAc,wBAAd;AACA,cAAc,oBAAd;AACA,cAAc,qBAAd;AACA,cAAc,4BAAd;AACA,cAAc,oBAAd;AACA,cAAc,yBAAd;AACA,cAAc,8BAAd;AACA,cAAc,qBAAd;AACA,cAAc,uBAAd;AACA,cAAc,sBAAd;AACA,cAAc,qBAAd;AACA,cAAc,uBAAd;AACA,cAAc,mBAAd;AACA,cAAc,uBAAd;AACA,cAAc,oBAAd;AACA,cAAc,0BAAd;AACA,cAAc,qBAAd;AACA,cAAc,oBAAd;AACA,cAAc,yBAAd;AACA,cAAc,sBAAd;AACA,cAAc,0BAAd;AACA,cAAc,+BAAd;AACA,cAAc,0BAAd;AACA,cAAc,2BAAd;AACA,cAAc,cAAd;AACA,cAAc,4BAAd;AACA,cAAc,4BAAd;AACA,cAAc,mCAAd;AACA,cAAc,gCAAd;AACA,cAAc,yCAAd;AACA,cAAc,sCAAd;AACA,cAAc,gCAAd;AACA,cAAc,oCAAd;AACA,cAAc,0CAAd;AACA,cAAc,8CAAd;AACA,cAAc,mBAAd;AACA,cAAc,wBAAd,C;AACgC,6B,6BAApBA,c;AACwB,iC,iCAAxBC,kB","sourcesContent":["export * from './components/Autocomplete';\nexport * from './components/Button';\nexport * from './components/Calendar';\nexport * from './components/Center';\nexport * from './components/Checkbox';\nexport * from './components/ComboBox';\nexport * from './components/CurrencyInput';\nexport * from './components/CurrencyLabel';\nexport * from './components/DateInput';\nexport * from './components/DatePicker';\nexport * from './components/Dropdown';\nexport * from './components/DropdownMenu';\nexport * from './components/FileUploader';\nexport * from './components/FxInput';\nexport * from './components/Gapped';\nexport * from './components/GlobalLoader';\nexport * from './components/Group';\nexport * from './components/Hint';\nexport * from './components/Input';\nexport * from './components/Kebab';\nexport * from './components/Link';\nexport * from './components/Loader';\nexport * from './components/MenuHeader';\nexport * from './components/MenuItem';\nexport * from './components/MenuSeparator';\nexport * from './components/MiniModal';\nexport * from './components/Modal';\nexport * from './components/Paging';\nexport * from './components/PasswordInput';\nexport * from './components/Radio';\nexport * from './components/RadioGroup';\nexport * from './components/ScrollContainer';\nexport * from './components/Select';\nexport * from './components/SidePage';\nexport * from './components/Spinner';\nexport * from './components/Sticky';\nexport * from './components/Switcher';\nexport * from './components/Tabs';\nexport * from './components/Textarea';\nexport * from './components/Toast';\nexport * from './components/SingleToast';\nexport * from './components/Toggle';\nexport * from './components/Token';\nexport * from './components/TokenInput';\nexport * from './components/Tooltip';\nexport * from './components/TooltipMenu';\nexport * from './components/ResponsiveLayout';\nexport * from './components/MaskedInput';\nexport * from './lib/featureFlagsContext';\nexport * from './lib/locale';\nexport * from './lib/theming/ThemeContext';\nexport * from './lib/theming/ThemeFactory';\nexport * from './lib/theming/themes/DefaultTheme';\nexport * from './lib/theming/themes/DarkTheme';\nexport * from './lib/theming/themes/DefaultTheme8pxOld';\nexport * from './lib/theming/themes/FlatTheme8pxOld';\nexport * from './lib/theming/themes/Theme2022';\nexport * from './lib/theming/themes/Theme2022Dark';\nexport * from './lib/theming/themes/Theme2022Update2024';\nexport * from './lib/theming/themes/Theme2022DarkUpdate2024';\nexport * from './lib/types/props';\nexport * from './internal/Popup/types';\nexport * as ColorFunctions from './lib/styles/ColorFunctions';\nexport * as DimensionFunctions from './lib/styles/DimensionFunctions';\n"]}
|