@snack-uikit/fields 0.38.2 → 0.39.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/CHANGELOG.md +25 -0
- package/README.md +1 -0
- package/dist/cjs/components/FieldText/FieldText.d.ts +1 -0
- package/dist/cjs/components/FieldText/FieldText.js +4 -3
- package/dist/esm/components/FieldText/FieldText.d.ts +1 -0
- package/dist/esm/components/FieldText/FieldText.js +2 -2
- package/package.json +8 -8
- package/src/components/FieldText/FieldText.tsx +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 0.39.0 (2025-02-04)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **PDS-161:** add type attribute to FieldText ([520fb32](https://github.com/cloud-ru-tech/snack-uikit/commit/520fb3214bc951ce4888745f633376f1a109c083))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 0.38.3 (2025-02-04)
|
|
18
|
+
|
|
19
|
+
### Only dependencies have been changed
|
|
20
|
+
* [@snack-uikit/calendar@0.11.19](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/calendar/CHANGELOG.md)
|
|
21
|
+
* [@snack-uikit/color-picker@0.3.13](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/color-picker/CHANGELOG.md)
|
|
22
|
+
* [@snack-uikit/list@0.24.1](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/list/CHANGELOG.md)
|
|
23
|
+
* [@snack-uikit/slider@0.3.7](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/slider/CHANGELOG.md)
|
|
24
|
+
* [@snack-uikit/tooltip@0.16.0](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/tooltip/CHANGELOG.md)
|
|
25
|
+
* [@snack-uikit/truncate-string@0.6.7](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/truncate-string/CHANGELOG.md)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
6
31
|
## 0.38.2 (2025-02-04)
|
|
7
32
|
|
|
8
33
|
|
package/README.md
CHANGED
|
@@ -450,6 +450,7 @@ FieldStepper в основном предназначен для работы с
|
|
|
450
450
|
| prefix | `ReactNode` | - | Произвольный префикс для поля |
|
|
451
451
|
| postfix | `ReactNode` | - | Произвольный постфикс для поля |
|
|
452
452
|
| button | `Button` | - | Кнопка действия внутри поля |
|
|
453
|
+
| type | "text" \| "tel" \| "email" | text | |
|
|
453
454
|
| onChange | `(value: string, e?: ChangeEvent<HTMLInputElement>) => void` | - | Колбек смены значения |
|
|
454
455
|
| value | `string` | - | Значение input |
|
|
455
456
|
| id | `string` | - | Значение html-атрибута id |
|
|
@@ -25,6 +25,7 @@ type FieldTextOwnProps = {
|
|
|
25
25
|
postfix?: ReactNode;
|
|
26
26
|
/** Кнопка действия внутри поля */
|
|
27
27
|
button?: Button;
|
|
28
|
+
type?: 'text' | 'tel' | 'email';
|
|
28
29
|
};
|
|
29
30
|
export type FieldTextProps = WithSupportProps<FieldTextOwnProps & InputProps & WrapperProps>;
|
|
30
31
|
export declare const FieldText: import("react").ForwardRefExoticComponent<{
|
|
@@ -61,9 +61,10 @@ exports.FieldText = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
61
61
|
postfix,
|
|
62
62
|
button: buttonProp,
|
|
63
63
|
onPaste,
|
|
64
|
-
onKeyDown
|
|
64
|
+
onKeyDown,
|
|
65
|
+
type = 'text'
|
|
65
66
|
} = _a,
|
|
66
|
-
rest = __rest(_a, ["id", "name", "value", "placeholder", "maxLength", "disabled", "readonly", "showCopyButton", "showClearButton", "allowMoreThanMaxLength", "onChange", "onFocus", "onBlur", "onCopyButtonClick", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "showHintIcon", "size", "validationState", "error", "autoComplete", "prefixIcon", "prefix", "postfix", "button", "onPaste", "onKeyDown"]);
|
|
67
|
+
rest = __rest(_a, ["id", "name", "value", "placeholder", "maxLength", "disabled", "readonly", "showCopyButton", "showClearButton", "allowMoreThanMaxLength", "onChange", "onFocus", "onBlur", "onCopyButtonClick", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "showHintIcon", "size", "validationState", "error", "autoComplete", "prefixIcon", "prefix", "postfix", "button", "onPaste", "onKeyDown", "type"]);
|
|
67
68
|
const [value = '', onChange] = (0, hooks_1.useValueControl)({
|
|
68
69
|
value: valueProp,
|
|
69
70
|
defaultValue: '',
|
|
@@ -203,7 +204,7 @@ exports.FieldText = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
203
204
|
placeholder: placeholder,
|
|
204
205
|
disabled: disabled,
|
|
205
206
|
readonly: readonly,
|
|
206
|
-
type:
|
|
207
|
+
type: type,
|
|
207
208
|
maxLength: allowMoreThanMaxLength ? undefined : maxLength || undefined,
|
|
208
209
|
id: id,
|
|
209
210
|
name: name,
|
|
@@ -25,6 +25,7 @@ type FieldTextOwnProps = {
|
|
|
25
25
|
postfix?: ReactNode;
|
|
26
26
|
/** Кнопка действия внутри поля */
|
|
27
27
|
button?: Button;
|
|
28
|
+
type?: 'text' | 'tel' | 'email';
|
|
28
29
|
};
|
|
29
30
|
export type FieldTextProps = WithSupportProps<FieldTextOwnProps & InputProps & WrapperProps>;
|
|
30
31
|
export declare const FieldText: import("react").ForwardRefExoticComponent<{
|
|
@@ -21,7 +21,7 @@ import { getValidationState } from '../../utils/getValidationState';
|
|
|
21
21
|
import { FieldDecorator } from '../FieldDecorator';
|
|
22
22
|
import { getContainerVariant } from './helpers';
|
|
23
23
|
export const FieldText = forwardRef((_a, ref) => {
|
|
24
|
-
var { id, name, value: valueProp, placeholder, maxLength, disabled = false, readonly = false, showCopyButton: showCopyButtonProp = true, showClearButton: showClearButtonProp = true, allowMoreThanMaxLength = false, onChange: onChangeProp, onFocus, onBlur, onCopyButtonClick, className, label, labelTooltip, labelTooltipPlacement, required = false, caption, hint, showHintIcon, size = SIZE.S, validationState = VALIDATION_STATE.Default, error, autoComplete, prefixIcon, prefix, postfix, button: buttonProp, onPaste, onKeyDown } = _a, rest = __rest(_a, ["id", "name", "value", "placeholder", "maxLength", "disabled", "readonly", "showCopyButton", "showClearButton", "allowMoreThanMaxLength", "onChange", "onFocus", "onBlur", "onCopyButtonClick", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "showHintIcon", "size", "validationState", "error", "autoComplete", "prefixIcon", "prefix", "postfix", "button", "onPaste", "onKeyDown"]);
|
|
24
|
+
var { id, name, value: valueProp, placeholder, maxLength, disabled = false, readonly = false, showCopyButton: showCopyButtonProp = true, showClearButton: showClearButtonProp = true, allowMoreThanMaxLength = false, onChange: onChangeProp, onFocus, onBlur, onCopyButtonClick, className, label, labelTooltip, labelTooltipPlacement, required = false, caption, hint, showHintIcon, size = SIZE.S, validationState = VALIDATION_STATE.Default, error, autoComplete, prefixIcon, prefix, postfix, button: buttonProp, onPaste, onKeyDown, type = 'text' } = _a, rest = __rest(_a, ["id", "name", "value", "placeholder", "maxLength", "disabled", "readonly", "showCopyButton", "showClearButton", "allowMoreThanMaxLength", "onChange", "onFocus", "onBlur", "onCopyButtonClick", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "showHintIcon", "size", "validationState", "error", "autoComplete", "prefixIcon", "prefix", "postfix", "button", "onPaste", "onKeyDown", "type"]);
|
|
25
25
|
const [value = '', onChange] = useValueControl({
|
|
26
26
|
value: valueProp,
|
|
27
27
|
defaultValue: '',
|
|
@@ -91,5 +91,5 @@ export const FieldText = forwardRef((_a, ref) => {
|
|
|
91
91
|
onInputKeyDown(event);
|
|
92
92
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
|
|
93
93
|
};
|
|
94
|
-
return (_jsx(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, required: required, caption: caption, length: maxLength ? { max: maxLength, current: value.length } : undefined, hint: hint, disabled: disabled, readonly: readonly, showHintIcon: showHintIcon, size: size, validationState: fieldValidationState, error: error }, extractSupportProps(rest), { children: _jsx(FieldContainerPrivate, { size: size, validationState: fieldValidationState, disabled: disabled, readonly: readonly, variant: containerVariant, inputRef: localRef, prefix: prefixButtons, postfix: postfixButtons, disableFocus: isButtonFocused, children: _jsx(InputPrivate, { ref: mergeRefs(ref, localRef), "data-size": size, value: value, onChange: onChange, onFocus: onFocus, onBlur: onBlur, tabIndex: inputTabIndex, onKeyDown: handleKeyDown, onPaste: onPaste, placeholder: placeholder, disabled: disabled, readonly: readonly, type:
|
|
94
|
+
return (_jsx(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, required: required, caption: caption, length: maxLength ? { max: maxLength, current: value.length } : undefined, hint: hint, disabled: disabled, readonly: readonly, showHintIcon: showHintIcon, size: size, validationState: fieldValidationState, error: error }, extractSupportProps(rest), { children: _jsx(FieldContainerPrivate, { size: size, validationState: fieldValidationState, disabled: disabled, readonly: readonly, variant: containerVariant, inputRef: localRef, prefix: prefixButtons, postfix: postfixButtons, disableFocus: isButtonFocused, children: _jsx(InputPrivate, { ref: mergeRefs(ref, localRef), "data-size": size, value: value, onChange: onChange, onFocus: onFocus, onBlur: onBlur, tabIndex: inputTabIndex, onKeyDown: handleKeyDown, onPaste: onPaste, placeholder: placeholder, disabled: disabled, readonly: readonly, type: type, maxLength: allowMoreThanMaxLength ? undefined : maxLength || undefined, id: id, name: name, autoComplete: autoComplete, "data-test-id": 'field-text__input' }) }) })));
|
|
95
95
|
});
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Fields",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.39.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"scripts": {},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@snack-uikit/button": "0.19.6",
|
|
40
|
-
"@snack-uikit/calendar": "0.11.
|
|
41
|
-
"@snack-uikit/color-picker": "0.3.
|
|
40
|
+
"@snack-uikit/calendar": "0.11.19",
|
|
41
|
+
"@snack-uikit/color-picker": "0.3.13",
|
|
42
42
|
"@snack-uikit/divider": "3.2.3",
|
|
43
43
|
"@snack-uikit/dropdown": "0.4.3",
|
|
44
44
|
"@snack-uikit/icons": "0.24.2",
|
|
45
45
|
"@snack-uikit/input-private": "4.5.1",
|
|
46
|
-
"@snack-uikit/list": "0.24.
|
|
46
|
+
"@snack-uikit/list": "0.24.1",
|
|
47
47
|
"@snack-uikit/scroll": "0.9.3",
|
|
48
48
|
"@snack-uikit/skeleton": "0.6.2",
|
|
49
|
-
"@snack-uikit/slider": "0.3.
|
|
49
|
+
"@snack-uikit/slider": "0.3.7",
|
|
50
50
|
"@snack-uikit/tag": "0.12.2",
|
|
51
|
-
"@snack-uikit/tooltip": "0.
|
|
52
|
-
"@snack-uikit/truncate-string": "0.6.
|
|
51
|
+
"@snack-uikit/tooltip": "0.16.0",
|
|
52
|
+
"@snack-uikit/truncate-string": "0.6.7",
|
|
53
53
|
"@snack-uikit/utils": "3.7.0",
|
|
54
54
|
"classnames": "2.5.1",
|
|
55
55
|
"copy-to-clipboard": "3.3.3",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@snack-uikit/locale": "*"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "a07145604050db9fe5d5ada9a4ae99d3cd6a1874"
|
|
69
69
|
}
|
|
@@ -72,6 +72,9 @@ type FieldTextOwnProps = {
|
|
|
72
72
|
postfix?: ReactNode;
|
|
73
73
|
/** Кнопка действия внутри поля */
|
|
74
74
|
button?: Button;
|
|
75
|
+
|
|
76
|
+
/* HTMLInputTypeAttribute */
|
|
77
|
+
type?: 'text' | 'tel' | 'email';
|
|
75
78
|
};
|
|
76
79
|
|
|
77
80
|
export type FieldTextProps = WithSupportProps<FieldTextOwnProps & InputProps & WrapperProps>;
|
|
@@ -111,6 +114,7 @@ export const FieldText = forwardRef<HTMLInputElement, FieldTextProps>(
|
|
|
111
114
|
button: buttonProp,
|
|
112
115
|
onPaste,
|
|
113
116
|
onKeyDown,
|
|
117
|
+
type = 'text',
|
|
114
118
|
...rest
|
|
115
119
|
},
|
|
116
120
|
ref,
|
|
@@ -250,7 +254,7 @@ export const FieldText = forwardRef<HTMLInputElement, FieldTextProps>(
|
|
|
250
254
|
placeholder={placeholder}
|
|
251
255
|
disabled={disabled}
|
|
252
256
|
readonly={readonly}
|
|
253
|
-
type=
|
|
257
|
+
type={type}
|
|
254
258
|
maxLength={allowMoreThanMaxLength ? undefined : maxLength || undefined}
|
|
255
259
|
id={id}
|
|
256
260
|
name={name}
|