From 9afc84e0873409a577e9bdf0de45dad97290a6a1 Mon Sep 17 00:00:00 2001 From: Vladimir Khvan Date: Mon, 3 Apr 2023 16:29:57 +0500 Subject: [PATCH] isLimitedWidth prop was deleted / showCopyIcon was renamed to enableCopy --- packages/components/textarea/index.js | 19 +++++++------------ .../components/textarea/styled-textarea.js | 4 ++-- .../components/textarea/textarea.stories.js | 6 ++---- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/packages/components/textarea/index.js b/packages/components/textarea/index.js index 640d450136..f39663736a 100644 --- a/packages/components/textarea/index.js +++ b/packages/components/textarea/index.js @@ -38,10 +38,9 @@ const Textarea = ({ areaSelect, isJSONField, copyInfoText, - showCopyIcon, + enableCopy, hasNumeration, - isFullHeight, - isLimitedWidth, + isFullHeight }) => { const areaRef = useRef(null); const [isError, setIsError] = useState(hasError); @@ -92,10 +91,9 @@ const Textarea = ({ return ( - {showCopyIcon && ( + {enableCopy && ( { copy(modifiedValue); @@ -127,7 +125,7 @@ const Textarea = ({ id={id} paddingLeftProp={paddingLeftProp} isJSONField={isJSONField} - showCopyIcon={showCopyIcon} + enableCopy={enableCopy} placeholder={placeholder} onChange={(e) => onChange && onChange(e)} maxLength={maxLength} @@ -189,13 +187,11 @@ Textarea.propTypes = { /** Indicates the text of toast/informational alarm */ copyInfoText: PropTypes.string, /** Shows copy icon */ - showCopyIcon: PropTypes.bool, + enableCopy: PropTypes.bool, /** Inserts numeration */ hasNumeration: PropTypes.bool, /** Calculating height of content depending on number of lines */ isFullHeight: PropTypes.bool, - /** Limits max width to 1200px */ - isLimitedWidth: PropTypes.bool, }; Textarea.defaultProps = { @@ -212,10 +208,9 @@ Textarea.defaultProps = { areaSelect: false, isJSONField: false, copyInfoText: "Content was copied successfully!", - showCopyIcon: false, + enableCopy: false, hasNumeration: false, isFullHeight: false, - isLimitedWidth: false, }; export default Textarea; diff --git a/packages/components/textarea/styled-textarea.js b/packages/components/textarea/styled-textarea.js index 78a882f885..0a43e1772b 100644 --- a/packages/components/textarea/styled-textarea.js +++ b/packages/components/textarea/styled-textarea.js @@ -71,7 +71,7 @@ const StyledTextarea = styled(ClearTextareaAutosize).attrs( outline: none; resize: none; overflow: ${(props) => (props.isJSONField ? "visible !important" : "hidden")}; - padding: ${(props) => (props.showCopyIcon ? "5px 28px 2px" : "5px 8px 2px")}; + padding: ${(props) => (props.enableCopy ? "5px 28px 2px" : "5px 8px 2px")}; padding-left: ${(props) => props.paddingLeftProp}; font-size: ${(props) => props.fontSize + "px"}; font-family: ${(props) => props.theme.fontFamily}; @@ -143,7 +143,7 @@ const Wrapper = styled.div` position: relative; min-width: ${(props) => (props.isJSONField ? "600px" : "none")}; - max-width: ${(props) => (props.isLimitedWidth ? "1200px" : "none")}; + max-width: 1200px; `; const Numeration = styled.pre` diff --git a/packages/components/textarea/textarea.stories.js b/packages/components/textarea/textarea.stories.js index 394d61502a..c892747fd1 100644 --- a/packages/components/textarea/textarea.stories.js +++ b/packages/components/textarea/textarea.stories.js @@ -46,10 +46,9 @@ Default.args = { value: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae", isJSONField: false, - showCopyIcon: false, + enableCopy: false, hasNumeration: false, isFullHeight: false, - isLimitedWidth: false, }; export const JsonViewer = Template.bind({}); @@ -67,8 +66,7 @@ JsonViewer.args = { value: '{"menu": {"id": "file","value": "File","popup": {"menuitem": [{"value": "New", "onclick": "CreateNewDoc()"},{"value": "Open", "onclick": "OpenDoc()"},{"value": "Close", "onclick": "CloseDoc()"}]}}}', isJSONField: true, - showCopyIcon: true, + enableCopy: true, hasNumeration: true, isFullHeight: true, - isLimitedWidth: true, }; \ No newline at end of file