PromucFlow_constructor/app/client/src/constants
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
..
ApiEditorConstants feat: Maintain Focus and Context Phase 1 (#16317) 2022-10-17 20:46:38 +05:30
AppsmithActionConstants feat: [APPSMTH-22] Execute action on widget focus and blur (#18128) 2022-12-12 12:39:22 +05:30
defs feat: Enable fetch API (#17832) 2022-12-01 03:28:58 +05:30
routes chore: [billing & usage] change the license check route (#19682) 2023-01-16 14:44:08 +05:30
AppConstants.ts feat: New settings pane (#16361) 2022-12-02 11:19:51 +05:30
BindingsConstants.ts Introduce different evaluation types for different binding fields (#3834) 2021-04-26 11:11:32 +05:30
CanvasEditorConstants.tsx feat: drag n drop and Container jump enhancements (#19047) 2023-01-06 22:27:40 +05:30
collectionsConstants.ts fix: ui fixes and type defination fixes 2020-04-14 12:34:14 +00:00
Colors.tsx chore: code split usage and billing files (#19436) 2023-01-10 11:09:15 +05:30
componentClassNameConstants.ts fix: offset while pasting widget from mouse position in Desktop mode (#19230) 2022-12-29 11:07:54 +00:00
Currency.tsx feat: Added Vanuatu Vatu to currency list (#16121) 2022-08-25 17:17:03 +05:30
Datasource.ts feat: Datasource autosave improvements (#17649) 2022-11-30 11:29:45 +05:30
DatasourceEditorConstants.ts added fixActionPayloadForMongoQuery (#13465) 2022-04-30 08:27:15 +05:30
DefaultTheme.tsx chore: update Styled components to latest version and related cleanup (#19284) 2023-01-13 16:35:59 +05:30
Explorer.ts fix: hide explorer menu on scroll (#15537) 2022-08-16 14:18:47 +05:30
FieldExpectedValue.ts Widget Property Validation structure (#5270) 2021-07-26 11:20:46 +05:30
Fonts.tsx Switching to system fonts (#344) 2020-08-19 03:21:23 +05:30
GitErrorCodes.ts chore: use documentation link from the error response for git errors (#10662) 2022-01-29 13:56:27 +05:30
HelpConstants.ts feat: Table widget v2 with support for non-ASCII characters and improved jest coverage (#11307) 2022-07-14 12:32:35 +05:30
IconConstants.tsx feat: ssh key regeneration (#11018) 2022-02-16 10:15:35 +00:00
ImagesURL.ts fix: Remove Success GIF and Add Tick Animation (#7925) 2021-10-13 09:43:57 +00:00
ISDCodes_v2.tsx feat: Input, Phone no., Currency input widget (#10259) 2022-01-18 13:22:24 +05:30
ISDCodes.tsx Input widget: New data type supported - Phone number with ISD codes (#5256) 2021-08-26 16:22:45 +05:30
KeyboardShortcuts.ts Tern autocomplete 2020-05-20 11:30:53 +00:00
Layers.tsx fix: auto height regression fixes (#18410) 2022-11-25 00:10:06 +05:30
PropertyControlConstants.tsx feat: Property pane search (#18164) 2022-12-11 20:12:32 +05:30
providerConstants.ts Upgrade npm packages (#1079) 2020-10-12 18:36:05 +05:30
QueryEditorConstants.ts feat: Maintain Focus and Context Phase 1 (#16317) 2022-10-17 20:46:38 +05:30
routes.test.ts chore: code changes to support clean urls v2 (#14757) 2022-07-11 09:36:29 +05:30
StyleConstants.tsx WIP: Fix eslint errors 2019-09-09 14:38:54 +05:30
ThemeConstants.tsx chore: Makes use of DS components in ThemeControls (#19000) 2022-12-23 15:37:29 +05:30
ThirdPartyConstants.tsx test: Update documentation URLs used in tests (#15419) 2022-07-26 12:58:07 +05:30
typography.ts refactor: admin settings (#9906) 2022-02-11 23:38:46 +05:30
userConstants.ts chore: Adding adminSettingsVisible variable in User type (#18961) 2022-12-15 11:42:46 +05:30
WebsocketConstants.tsx refactor: client side rts (#7837) 2021-10-01 16:44:19 +00:00
WidgetConstants.tsx feat: multi-line input and auto-resize textarea (#19141) 2023-01-17 18:46:35 +05:30
WidgetValidation.ts feat: Dynamic Menu Items - Menu Button Widget (#17652) 2022-12-01 10:25:57 +05:30