@snack-uikit/fields 0.55.3-preview-8bb75172.0 → 0.56.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 CHANGED
@@ -3,6 +3,28 @@
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.56.1 (2026-05-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **MKP-3566:** remove unnecessary var() function ([8bd32d9](https://github.com/cloud-ru-tech/snack-uikit/commit/8bd32d932af85f87cf7cd9077fc7120a85fdc39c))
12
+
13
+
14
+
15
+
16
+
17
+ # 0.56.0 (2026-05-26)
18
+
19
+
20
+ ### Features
21
+
22
+ * **PDS-3805:** visible copy-button on not-readonly field-text-area ([c11c83a](https://github.com/cloud-ru-tech/snack-uikit/commit/c11c83aa11fdc410db03386edf965995fce7e408))
23
+
24
+
25
+
26
+
27
+
6
28
  ## 0.55.2 (2026-05-18)
7
29
 
8
30
  ### Only dependencies have been changed
package/README.md CHANGED
@@ -895,7 +895,7 @@ FieldStepper в основном предназначен для работы с
895
895
  | maxRows | `number` | 1000 | Максимальное кол-во строк, до которого размер поля может быть увеличен |
896
896
  | resizable | `boolean` | - | Может ли ли пользователь изменять размеры поля (если св-во не включено, поле автоматически меняет свой размер) |
897
897
  | onChange | `(value: string, e?: ChangeEvent<HTMLTextAreaElement>) => void` | - | Колбек смены значения |
898
- | showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля (актуально только для `readonly = true`) |
898
+ | showCopyButton | `boolean` | - | Отображение кнопки Копировать для поля |
899
899
  | onCopyButtonClick | `() => void` | - | Колбек клика по кнопке Копировать для поля |
900
900
  | showClearButton | `boolean` | true | Отображение кнопки очистки поля |
901
901
  | allowMoreThanMaxLength | `boolean` | true | Можно ли вводить больше разрешённого кол-ва символов |
@@ -13,7 +13,7 @@ type FieldTextAreaOwnProps = {
13
13
  resizable?: boolean;
14
14
  /** Колбек смены значения */
15
15
  onChange?(value: string, e?: ChangeEvent<HTMLTextAreaElement>): void;
16
- /** Отображение кнопки Копировать для поля (актуально только для `readonly = true`) */
16
+ /** Отображение кнопки Копировать для поля */
17
17
  showCopyButton?: boolean;
18
18
  /** Колбек клика по кнопке Копировать для поля */
19
19
  onCopyButtonClick?(): void;
@@ -41,7 +41,7 @@ exports.FieldTextArea = (0, react_1.forwardRef)((_a, ref) => {
41
41
  disabled = false,
42
42
  resizable = false,
43
43
  readonly = false,
44
- showCopyButton: showCopyButtonProp = true,
44
+ showCopyButton: showCopyButtonProp = readonly,
45
45
  showClearButton: showClearButtonProp = true,
46
46
  allowMoreThanMaxLength = true,
47
47
  showHintIcon,
@@ -75,7 +75,7 @@ exports.FieldTextArea = (0, react_1.forwardRef)((_a, ref) => {
75
75
  defaultValue: '',
76
76
  onChange: onChangeProp
77
77
  });
78
- const showCopyButton = showCopyButtonProp && Boolean(value) && !disabled && readonly;
78
+ const showCopyButton = showCopyButtonProp && Boolean(value) && !disabled;
79
79
  const showClearButton = showClearButtonProp && Boolean(value) && !disabled && !readonly;
80
80
  const fieldValidationState = (0, getValidationState_1.getValidationState)({
81
81
  validationState,
@@ -13,7 +13,7 @@ type FieldTextAreaOwnProps = {
13
13
  resizable?: boolean;
14
14
  /** Колбек смены значения */
15
15
  onChange?(value: string, e?: ChangeEvent<HTMLTextAreaElement>): void;
16
- /** Отображение кнопки Копировать для поля (актуально только для `readonly = true`) */
16
+ /** Отображение кнопки Копировать для поля */
17
17
  showCopyButton?: boolean;
18
18
  /** Колбек клика по кнопке Копировать для поля */
19
19
  onCopyButtonClick?(): void;
@@ -22,7 +22,7 @@ import { getValidationState } from '../../utils/getValidationState';
22
22
  import { FieldDecorator } from '../FieldDecorator';
23
23
  import styles from './styles.module.css';
24
24
  export const FieldTextArea = forwardRef((_a, ref) => {
25
- var { id, name, value: valueProp, placeholder, maxLength, minRows = 3, maxRows = 1000, disabled = false, resizable = false, readonly = false, showCopyButton: showCopyButtonProp = true, showClearButton: showClearButtonProp = true, allowMoreThanMaxLength = true, showHintIcon, onChange: onChangeProp, onFocus, onBlur, onKeyDown, className, label, labelTooltip, labelTooltipPlacement, required = false, caption, hint, error, size = SIZE.S, validationState = VALIDATION_STATE.Default, onCopyButtonClick, footer, spellCheck, autoFocus, inputMode } = _a, rest = __rest(_a, ["id", "name", "value", "placeholder", "maxLength", "minRows", "maxRows", "disabled", "resizable", "readonly", "showCopyButton", "showClearButton", "allowMoreThanMaxLength", "showHintIcon", "onChange", "onFocus", "onBlur", "onKeyDown", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "error", "size", "validationState", "onCopyButtonClick", "footer", "spellCheck", "autoFocus", "inputMode"]);
25
+ var { id, name, value: valueProp, placeholder, maxLength, minRows = 3, maxRows = 1000, disabled = false, resizable = false, readonly = false, showCopyButton: showCopyButtonProp = readonly, showClearButton: showClearButtonProp = true, allowMoreThanMaxLength = true, showHintIcon, onChange: onChangeProp, onFocus, onBlur, onKeyDown, className, label, labelTooltip, labelTooltipPlacement, required = false, caption, hint, error, size = SIZE.S, validationState = VALIDATION_STATE.Default, onCopyButtonClick, footer, spellCheck, autoFocus, inputMode } = _a, rest = __rest(_a, ["id", "name", "value", "placeholder", "maxLength", "minRows", "maxRows", "disabled", "resizable", "readonly", "showCopyButton", "showClearButton", "allowMoreThanMaxLength", "showHintIcon", "onChange", "onFocus", "onBlur", "onKeyDown", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "error", "size", "validationState", "onCopyButtonClick", "footer", "spellCheck", "autoFocus", "inputMode"]);
26
26
  const localRef = useRef(null);
27
27
  const clearButtonRef = useRef(null);
28
28
  const copyButtonRef = useRef(null);
@@ -32,7 +32,7 @@ export const FieldTextArea = forwardRef((_a, ref) => {
32
32
  defaultValue: '',
33
33
  onChange: onChangeProp,
34
34
  });
35
- const showCopyButton = showCopyButtonProp && Boolean(value) && !disabled && readonly;
35
+ const showCopyButton = showCopyButtonProp && Boolean(value) && !disabled;
36
36
  const showClearButton = showClearButtonProp && Boolean(value) && !disabled && !readonly;
37
37
  const fieldValidationState = getValidationState({ validationState, error });
38
38
  const onClear = () => {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Fields",
7
- "version": "0.55.3-preview-8bb75172.0",
7
+ "version": "0.56.1",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -66,5 +66,5 @@
66
66
  "peerDependencies": {
67
67
  "@snack-uikit/locale": "*"
68
68
  },
69
- "gitHead": "16559a6d4a4a187a88174c19bdb2de2dcb6ef338"
69
+ "gitHead": "2c9dc775079a8f151e220346e69a617e901dd8a2"
70
70
  }
@@ -53,7 +53,7 @@ type FieldTextAreaOwnProps = {
53
53
  resizable?: boolean;
54
54
  /** Колбек смены значения */
55
55
  onChange?(value: string, e?: ChangeEvent<HTMLTextAreaElement>): void;
56
- /** Отображение кнопки Копировать для поля (актуально только для `readonly = true`) */
56
+ /** Отображение кнопки Копировать для поля */
57
57
  showCopyButton?: boolean;
58
58
  /** Колбек клика по кнопке Копировать для поля */
59
59
  onCopyButtonClick?(): void;
@@ -83,7 +83,7 @@ export const FieldTextArea = forwardRef<HTMLTextAreaElement, FieldTextAreaProps>
83
83
  disabled = false,
84
84
  resizable = false,
85
85
  readonly = false,
86
- showCopyButton: showCopyButtonProp = true,
86
+ showCopyButton: showCopyButtonProp = readonly,
87
87
  showClearButton: showClearButtonProp = true,
88
88
  allowMoreThanMaxLength = true,
89
89
  showHintIcon,
@@ -120,7 +120,7 @@ export const FieldTextArea = forwardRef<HTMLTextAreaElement, FieldTextAreaProps>
120
120
  defaultValue: '',
121
121
  onChange: onChangeProp,
122
122
  });
123
- const showCopyButton = showCopyButtonProp && Boolean(value) && !disabled && readonly;
123
+ const showCopyButton = showCopyButtonProp && Boolean(value) && !disabled;
124
124
  const showClearButton = showClearButtonProp && Boolean(value) && !disabled && !readonly;
125
125
 
126
126
  const fieldValidationState = getValidationState({ validationState, error });