@topconsultnpm/sdkui-react-beta 6.9.39 → 6.9.41
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.
|
@@ -64,7 +64,7 @@ export const StyledEditorLabel = styled.div `
|
|
|
64
64
|
`;
|
|
65
65
|
export const StyledTextareaEditor = styled.textarea `
|
|
66
66
|
width: ${props => props.$width};
|
|
67
|
-
padding:
|
|
67
|
+
padding: 4px 5px 4px 13px;
|
|
68
68
|
border: 1px solid;
|
|
69
69
|
border-color: ${props => props.$isModified ? TMColors.isModified : TMColors.border_normal};
|
|
70
70
|
border-bottom: ${props => (props.$vil.length > 0) ? '3px' : '1px'} solid;
|
|
@@ -80,6 +80,8 @@ const TMTextArea = (props) => {
|
|
|
80
80
|
};
|
|
81
81
|
// Calculate the number of rows required to display the content
|
|
82
82
|
const calculateRows = (content) => {
|
|
83
|
+
if (content === undefined || content.length === 0)
|
|
84
|
+
return 1;
|
|
83
85
|
if (!inputRef.current)
|
|
84
86
|
return rows ?? 1;
|
|
85
87
|
const textareaWidth = inputRef.current.offsetWidth;
|
|
@@ -134,9 +136,10 @@ const TMTextArea = (props) => {
|
|
|
134
136
|
const y = e.clientY - bounds.top;
|
|
135
137
|
// set the x and y coordinates of our users right click
|
|
136
138
|
setPoints({ x, y });
|
|
137
|
-
}, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width, "$resize": resize }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: label.length > 0 ? '
|
|
139
|
+
}, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width, "$resize": resize }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: label.length > 0 ? '22px' : '7px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [showClearButton && currentValue &&
|
|
138
140
|
_jsx(StyledTextAreaEditorButton, { onClick: () => {
|
|
139
141
|
onValueChanged?.({ target: { value: undefined } });
|
|
142
|
+
setCurrentValue('');
|
|
140
143
|
setCalculatedRows(1);
|
|
141
144
|
onBlur?.(undefined);
|
|
142
145
|
}, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
|
|
@@ -146,7 +146,7 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, scale, showCle
|
|
|
146
146
|
e.preventDefault();
|
|
147
147
|
}
|
|
148
148
|
}, "$isMobile": deviceType === DeviceType.MOBILE, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType, "$borderRadius": borderRadius }), initialType === 'password' && currentValue && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), initialType !== 'password' &&
|
|
149
|
-
_jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : '6px', top: label.length > 0 ? '
|
|
149
|
+
_jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : '6px', top: label.length > 0 ? '22px' : '7px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [showClearButton && currentValue &&
|
|
150
150
|
_jsx(StyledTextBoxEditorButton, { onClick: () => {
|
|
151
151
|
onValueChanged?.({ target: { value: undefined } });
|
|
152
152
|
onBlur?.(undefined);
|