PromucFlow_constructor/app/client/src/components/editorComponents
ankurrsinghal 68d21fba7c
feat: multi-line input and auto-resize textarea (#19141)
## Description

Features:-
1. Created a new AutoResizeTextArea component in the editorComponents.
Textarea does not increase its height on adding text, but it increases
its scroll height. To accommodate Auto Height with the
textarea/Multi-line InputWidget, I have created a new TextArea component
which changes its height when its content changes based on its
scrollHeight. This is done by creating another hidden similar proxy
Textarea with contents equal to the widget's value, and whenever this
value changes we run a layout effect that sets the main text area height
equal to the scrollHeight of the proxy textarea.

2. Added a new configuration `Multi-line` for InputWidget in the
Data-Type which will decide whether to replace the `input` element with
`textarea`.
Currently, the way to decide whether we should display a textarea or not
is based on whether widget's height is greater than 8 rows or not. To
fix it, I added a proper configuration which will user to select whether
he/she wants a Single-line input or Multi-line textarea.

3. Replaced the label of `Text` configuration to `Single-line` which
remains a simple `input` element as before.
Changed the label of the Text configuration to Single-line in contrast
with Multi-line.

4. Migration
Added migration number 75 for the InputWidgetsV2. Used the same previous
logic to detect whether the input type should be multiple-line or not
and set the `inputType` to `MULTI_LINE_TEXT` if it's true.

5. Changed a lot of CSS styling in Input components (Currency and Phone
too) so that they look similar to other components like DatePicker and
Select. Currently the input component take containers height which is
different from other components.

6. The onSubmit behaviour of the Multi-line input has also changed. Now
the line-break will happen on Enter and submit will be triggered on Cmd
+ Enter.

7. Added an updateHook in the Input widget which when selected the
Multi-line input will set its dynamic height property to AutoHeight.


Fixes #19655


Media
> A video or a GIF is preferred. when using Loom, don’t embed because it
looks like it’s a GIF. instead, just link to the video


## Type of change

- New feature (non-breaking change which adds functionality)


## How Has This Been Tested?
- Manual
- Jest

### Test Plan

https://github.com/appsmithorg/TestSmith/issues/2151

### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)


## Checklist:
### Dev activity
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


### QA activity:
- [x] Test plan has been approved by relevant developers
- [x] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test

Co-authored-by: Apple <nandan@thinkify.io>
Co-authored-by: Parthvi Goswami <parthvigoswami@Parthvis-MacBook-Pro.local>
2023-01-17 18:46:35 +05:30
..
ActionCreator chore: update Styled components to latest version and related cleanup (#19284) 2023-01-13 16:35:59 +05:30
ActionRightPane feat: update button states (#18335) 2022-12-07 11:44:30 +00:00
CodeEditor fix: Api new line chars getting lost issue fixed (#19298) 2023-01-13 19:44:51 +05:30
Debugger chore: update Styled components to latest version and related cleanup (#19284) 2023-01-13 16:35:59 +05:30
form fix: Api new line chars getting lost issue fixed (#19298) 2023-01-13 19:44:51 +05:30
GlobalSearch chore: update Styled components to latest version and related cleanup (#19284) 2023-01-13 16:35:59 +05:30
HighlightedCode
LazyCodeEditorWrapper feat: [Context Switching]: Change focus target and fix cursor position (#17794) 2022-11-15 11:50:18 +05:30
LightningMenu chore: update Styled components to latest version and related cleanup (#19284) 2023-01-13 16:35:59 +05:30
WidgetNameComponent chore: update Styled components to latest version and related cleanup (#19284) 2023-01-13 16:35:59 +05:30
ActionNameEditor.tsx feat: Handle permission driven views for auto-saving pages and action… (#16950) 2022-12-01 12:00:50 +05:30
ApiResponseView.tsx chore: update Styled components to latest version and related cleanup (#19284) 2023-01-13 16:35:59 +05:30
AutoResizeTextArea.test.tsx feat: multi-line input and auto-resize textarea (#19141) 2023-01-17 18:46:35 +05:30
AutoResizeTextArea.tsx feat: multi-line input and auto-resize textarea (#19141) 2023-01-17 18:46:35 +05:30
BetaCard.tsx feat: App Theming (#9714) 2022-05-04 15:15:57 +05:30
Button.tsx fix: fetching the plugin form config for queries if datasource is not viewable (#18749) 2022-12-08 09:06:35 +05:30
Checkbox.tsx
CloseEditor.tsx fix: google sheet ui issues, removed redundant code (#18785) 2022-12-20 20:40:18 +05:30
ContextDropdown.tsx
Divider.tsx
DraggableComponent.test.tsx fix: Switch to preview mode performance issue (#18457) 2022-11-27 22:42:00 +05:30
DraggableComponent.tsx fix: Switch to preview mode performance issue (#18457) 2022-11-27 22:42:00 +05:30
DragLayerComponent.test.tsx chore: update Styled components to latest version and related cleanup (#19284) 2023-01-13 16:35:59 +05:30
DragLayerComponent.tsx
DropdownComponent.tsx chore: update Styled components to latest version and related cleanup (#19284) 2023-01-13 16:35:59 +05:30
DropTargetComponent.tsx fix: Switch to preview mode performance issue (#18457) 2022-11-27 22:42:00 +05:30
DropTargetUtils.ts fix: Extra Space at the end of the Canvas in Viewmode (#16747) 2022-09-30 13:49:52 +05:30
EditableText.tsx chore: Addressing changes requested by the design team during design QA (#19041) 2022-12-20 12:19:57 +05:30
EditorContextProvider.tsx feat: Auto-height add reducers and actions (#17953) 2022-11-14 09:49:25 +05:30
EntityBottomTabs.tsx feat: Maintain Focus and Context Phase 1 (#16317) 2022-10-17 20:46:38 +05:30
EntityNameComponent.tsx
ErrorBoundry.tsx
ErrorTooltip.tsx feat: Automatic height updates for widgets based on contents (Auto Height) (#18341) 2022-11-23 15:18:23 +05:30
Form.tsx
FormLabel.tsx
FormRow.tsx
HelperTooltip.tsx
InputComponent.tsx
JSResponseView.tsx chore: import common variables from design system (#17600) 2022-10-31 06:54:47 +05:30
LetterIcon.tsx
LoadingOverlayScreen.tsx
NavBarItem.tsx
PageLoader.tsx
PaneWrapper.tsx
PropertyPaneSidebar.tsx feat: Multi Pane IDE: Phase 1 (#19261) 2023-01-09 10:54:41 +05:30
ReadOnlyEditor.tsx fix: Slow rendering of JSON and RAW response (#16971) 2022-09-30 20:51:04 +05:30
RequestView.tsx
ResizableComponent.tsx feat: drag n drop and Container jump enhancements (#19047) 2023-01-06 22:27:40 +05:30
ResizableUtils.test.ts feat: Automatic height updates for widgets based on contents (Auto Height) (#18341) 2022-11-23 15:18:23 +05:30
ResizableUtils.ts feat: drag n drop and Container jump enhancements (#19047) 2023-01-06 22:27:40 +05:30
ResizeStyledComponents.tsx feat: Automatic height updates for widgets based on contents (Auto Height) (#18341) 2022-11-23 15:18:23 +05:30
SelectComponent.tsx
Sidebar.tsx chore: update Styled components to latest version and related cleanup (#19284) 2023-01-13 16:35:59 +05:30
SnipeableComponent.tsx perf: Widget layer optimization (#16502) 2022-09-14 12:25:08 +05:30
Spinner.tsx
StoreAsDatasource.tsx feat: [ Context Switching ] Maintain datasource edit mode (#17521) 2022-12-02 08:36:22 +05:30
Tooltip.tsx
utils.test.ts feat: upgrade to create react app 5 (#14000) 2022-06-21 19:27:34 +05:30
utils.ts fix:prevent execution of js function when jscollection is saving (#13592) 2022-05-19 14:13:51 +01:00