@true-engineering/true-react-common-ui-kit 4.0.0-alpha15 → 4.0.0-alpha17
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/dist/components/TextArea/TextArea.d.ts +1 -3
- package/dist/true-react-common-ui-kit.js +7 -5
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +7 -5
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Input/InputBase.tsx +2 -3
- package/src/components/TextArea/TextArea.tsx +8 -5
package/package.json
CHANGED
|
@@ -19,9 +19,8 @@ import {
|
|
|
19
19
|
isNotEmpty,
|
|
20
20
|
isReactNodeNotEmpty,
|
|
21
21
|
isStringNotEmpty,
|
|
22
|
-
mergeRefs,
|
|
23
22
|
} from '@true-engineering/true-react-platform-helpers';
|
|
24
|
-
import { useTweakStyles } from '../../hooks';
|
|
23
|
+
import { useMergedRefs, useTweakStyles } from '../../hooks';
|
|
25
24
|
import { IClickHandlerEvent, ICommonProps } from '../../types';
|
|
26
25
|
import { ControlWrapper, IControlWrapperProps } from '../ControlWrapper';
|
|
27
26
|
import { IChangeInputEvent } from './types';
|
|
@@ -120,7 +119,7 @@ export const InputBase = forwardRef<HTMLInputElement, IInputBaseProps>(
|
|
|
120
119
|
const [unitsWidth, setUnitsWidth] = useState<number>();
|
|
121
120
|
|
|
122
121
|
const inputRef = useRef<HTMLInputElement>(null);
|
|
123
|
-
const mergedRef =
|
|
122
|
+
const mergedRef = useMergedRefs([ref, inputRef]);
|
|
124
123
|
|
|
125
124
|
// Try to guess input-mode if possible
|
|
126
125
|
const inputMode: IInputBaseProps['inputMode'] =
|
|
@@ -24,13 +24,14 @@ import { ITextAreaStyles, useStyles } from './TextArea.styles';
|
|
|
24
24
|
export interface ITextAreaProps
|
|
25
25
|
extends ICommonProps<ITextAreaStyles>,
|
|
26
26
|
Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange'>,
|
|
27
|
-
Pick<
|
|
27
|
+
Pick<
|
|
28
|
+
IControlWrapperProps,
|
|
29
|
+
'label' | 'isInvalid' | 'isRequired' | 'isDisabled' | 'size' | 'groupPlacement'
|
|
30
|
+
>,
|
|
28
31
|
Pick<IWithMessagesProps, 'infoMessage' | 'errorMessage'> {
|
|
29
32
|
value?: string;
|
|
30
33
|
placeholder?: string;
|
|
31
34
|
/** @default false */
|
|
32
|
-
isDisabled?: boolean;
|
|
33
|
-
/** @default false */
|
|
34
35
|
isActive?: boolean;
|
|
35
36
|
/**
|
|
36
37
|
* Должна ли высота и ширина textarea подстраиваться под содержимое
|
|
@@ -54,7 +55,6 @@ export const TextArea = forwardRef<HTMLTextAreaElement, ITextAreaProps>(
|
|
|
54
55
|
(
|
|
55
56
|
{
|
|
56
57
|
value = DEFAULT_VALUE,
|
|
57
|
-
label,
|
|
58
58
|
placeholder,
|
|
59
59
|
name,
|
|
60
60
|
shouldFocusOnMount,
|
|
@@ -62,7 +62,6 @@ export const TextArea = forwardRef<HTMLTextAreaElement, ITextAreaProps>(
|
|
|
62
62
|
shouldTrimAfterMaxLength,
|
|
63
63
|
isAutoSized = true,
|
|
64
64
|
shouldAlwaysShowPlaceholder,
|
|
65
|
-
isDisabled,
|
|
66
65
|
isActive,
|
|
67
66
|
maxLength,
|
|
68
67
|
rows,
|
|
@@ -77,9 +76,12 @@ export const TextArea = forwardRef<HTMLTextAreaElement, ITextAreaProps>(
|
|
|
77
76
|
infoMessage,
|
|
78
77
|
errorMessage,
|
|
79
78
|
// Пропсы ControlWrapper
|
|
79
|
+
label,
|
|
80
|
+
isDisabled,
|
|
80
81
|
isInvalid,
|
|
81
82
|
isRequired,
|
|
82
83
|
size,
|
|
84
|
+
groupPlacement,
|
|
83
85
|
...textAreaProps
|
|
84
86
|
},
|
|
85
87
|
ref,
|
|
@@ -135,6 +137,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, ITextAreaProps>(
|
|
|
135
137
|
hasValue={hasValue}
|
|
136
138
|
isInvalid={isInvalid}
|
|
137
139
|
isRequired={isRequired}
|
|
140
|
+
groupPlacement={groupPlacement}
|
|
138
141
|
size={size}
|
|
139
142
|
isFullWidth
|
|
140
143
|
>
|