@topconsultnpm/sdkui-react-beta 6.8.19 → 6.8.20
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.
|
@@ -97,6 +97,7 @@ export const StyledTextareaEditor = styled.textarea `
|
|
|
97
97
|
border-radius: ${props => props.$borderRadius ?? TMEditorsDefaultBorderRadius}; /* Slightly increased radius for smoother corners */
|
|
98
98
|
min-width: ${props => (props.$isMobile ? '70px' : '100%')}; /* Adjust for mobile */
|
|
99
99
|
max-height: ${props => props.$maxHeight || 'auto'};
|
|
100
|
+
resize: ${props => (props.$resize === false ? 'none' : 'both')};
|
|
100
101
|
&:focus {
|
|
101
102
|
outline: none;
|
|
102
103
|
background-image: linear-gradient(white, #E4E9F7);
|
|
@@ -11,7 +11,7 @@ import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
|
|
|
11
11
|
// Define the TMTextArea component
|
|
12
12
|
const TMTextArea = (props) => {
|
|
13
13
|
// Extract properties from the props object
|
|
14
|
-
const { label = '', value = '', width = '100%', height = 'auto', autoFocus = false, validationItems = [], disabled = false, isModifiedWhen = false, fontSize = FontSize.defaultFontSize, elementStyle = {}, icon = null, labelPosition = 'left', readOnly = false, onValueChanged, onBlur, placeHolder, formulaItems = [], buttons = [], maxHeight = 'auto', rows, maxLength } = props;
|
|
14
|
+
const { label = '', value = '', width = '100%', height = 'auto', autoFocus = false, validationItems = [], disabled = false, isModifiedWhen = false, fontSize = FontSize.defaultFontSize, elementStyle = {}, icon = null, labelPosition = 'left', readOnly = false, onValueChanged, onBlur, placeHolder, formulaItems = [], buttons = [], maxHeight = 'auto', rows, maxLength, resize = true } = props;
|
|
15
15
|
// Reference to the textarea DOM element
|
|
16
16
|
const inputRef = useRef(null);
|
|
17
17
|
// Stores the textarea is focused
|
|
@@ -108,7 +108,7 @@ const TMTextArea = (props) => {
|
|
|
108
108
|
const y = e.clientY - bounds.top;
|
|
109
109
|
// set the x and y coordinates of our users right click
|
|
110
110
|
setPoints({ x, y });
|
|
111
|
-
}, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width }), buttons.map((buttonItem, index) => {
|
|
111
|
+
}, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width, "$resize": resize }), buttons.map((buttonItem, index) => {
|
|
112
112
|
return (_jsx(StyledEditorButtonIcon, { onClick: buttonItem.onClick, "$index": index, "$transform": '-26px', children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, index));
|
|
113
113
|
}), formulaItems.length > 0 && clicked && (_jsx(TMContextMenu, { menuData: formulaMenuItems, top: points.y, left: points.x, onMenuItemClick: (formula) => insertText(formula) })), _jsx(TMVilViewer, { vil: validationItems })] });
|
|
114
114
|
};
|