2023-03-04 07:25:54 +00:00
import { Alignment } from "@blueprintjs/core" ;
import { LabelPosition } from "components/constants" ;
2022-02-02 14:15:07 +00:00
import { EventType } from "constants/AppsmithActionConstants/ActionConstants" ;
2023-03-04 07:25:54 +00:00
import { Layers } from "constants/Layers" ;
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### Test Plan
> Add Testsmith test cases links that relate to this PR
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag
### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] 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: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
import { ValidationTypes } from "constants/WidgetValidation" ;
2023-07-08 14:07:26 +00:00
import type { SetterConfig , Stylesheet } from "entities/AppTheming" ;
2022-02-02 14:15:07 +00:00
import { EvaluationSubstitutionType } from "entities/DataTree/dataTreeFactory" ;
2023-03-04 07:25:54 +00:00
import equal from "fast-deep-equal/es6" ;
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### Test Plan
> Add Testsmith test cases links that relate to this PR
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag
### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] 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: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
import { isArray , isFinite , isString , xorWith } from "lodash" ;
import type { DraftValueType , LabelInValueType } from "rc-select/lib/Select" ;
2023-03-04 07:25:54 +00:00
import React from "react" ;
2023-05-11 05:26:03 +00:00
import { AutocompleteDataType } from "utils/autocomplete/AutocompleteDataType" ;
2023-09-11 15:55:11 +00:00
import { isAutoLayout } from "layoutSystems/autolayout/utils/flexWidgetUtils" ;
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### Test Plan
> Add Testsmith test cases links that relate to this PR
### 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
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag
### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] 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: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
import type { WidgetProps , WidgetState } from "widgets/BaseWidget" ;
import BaseWidget from "widgets/BaseWidget" ;
2023-09-06 12:15:04 +00:00
import {
GRID_DENSITY_MIGRATION_V1 ,
MinimumPopupRows ,
} from "WidgetProvider/constants" ;
2023-04-14 06:27:49 +00:00
import {
isAutoHeightEnabledForWidget ,
DefaultAutocompleteDefinitions ,
} from "widgets/WidgetUtils" ;
2023-03-04 07:25:54 +00:00
import MultiSelectComponent from "../component" ;
import derivedProperties from "./parseDerivedProperties" ;
2023-09-06 12:15:04 +00:00
import type { AutocompletionDefinitions } from "WidgetProvider/constants" ;
2023-07-25 04:56:33 +00:00
import {
defaultValueExpressionPrefix ,
getDefaultValueExpressionSuffix ,
getOptionLabelValueExpressionPrefix ,
optionLabelValueExpressionSuffix ,
} from "../constants" ;
import {
defaultOptionValueValidation ,
labelKeyValidation ,
getLabelValueAdditionalAutocompleteData ,
getLabelValueKeyOptions ,
valueKeyValidation ,
} from "./propertyUtils" ;
2023-08-10 05:21:19 +00:00
import type {
WidgetQueryConfig ,
WidgetQueryGenerationFormConfig ,
} from "WidgetQueryGenerators/types" ;
2023-09-06 12:15:04 +00:00
import { FILL_WIDGET_MIN_WIDTH } from "constants/minWidthConstants" ;
2023-09-11 15:55:11 +00:00
import { ResponsiveBehavior } from "layoutSystems/autolayout/utils/constants" ;
2023-09-06 12:15:04 +00:00
import { DynamicHeight } from "utils/WidgetFeatures" ;
import IconSVG from "../icon.svg" ;
import { WIDGET_TAGS } from "constants/WidgetConstants" ;
2022-02-02 14:15:07 +00:00
class MultiSelectWidget extends BaseWidget <
MultiSelectWidgetProps ,
WidgetState
> {
2023-09-06 12:15:04 +00:00
static type = "MULTI_SELECT_WIDGET_V2" ;
static getConfig() {
2023-08-10 05:21:19 +00:00
return {
2023-09-06 12:15:04 +00:00
name : "MultiSelect" ,
iconSVG : IconSVG ,
tags : [ WIDGET_TAGS . SELECT ] ,
needsMeta : true ,
searchTags : [ "dropdown" , "tags" ] ,
} ;
}
static getFeatures() {
return {
dynamicHeight : {
sectionIndex : 4 ,
defaultValue : DynamicHeight.FIXED ,
active : true ,
2023-08-10 05:21:19 +00:00
} ,
} ;
}
2023-09-06 12:15:04 +00:00
static getDefaults() {
return {
rows : 7 ,
columns : 20 ,
animateLoading : true ,
labelText : "Label" ,
labelPosition : LabelPosition.Top ,
labelAlignment : Alignment.LEFT ,
labelWidth : 5 ,
labelTextSize : "0.875rem" ,
sourceData : [
{ name : "Blue" , code : "BLUE" } ,
{ name : "Green" , code : "GREEN" } ,
{ name : "Red" , code : "RED" } ,
] ,
optionLabel : "name" ,
optionValue : "code" ,
widgetName : "MultiSelect" ,
isFilterable : true ,
serverSideFiltering : false ,
defaultOptionValue : [ "GREEN" , "RED" ] ,
version : 1 ,
isRequired : false ,
isDisabled : false ,
placeholderText : "Select option(s)" ,
responsiveBehavior : ResponsiveBehavior.Fill ,
minWidth : FILL_WIDGET_MIN_WIDTH ,
} ;
}
2023-08-10 05:21:19 +00:00
2023-09-06 12:15:04 +00:00
static getAutoLayoutConfig() {
return {
disabledPropsDefaults : {
labelPosition : LabelPosition.Top ,
labelTextSize : "0.875rem" ,
} ,
defaults : {
rows : 6.6 ,
} ,
autoDimension : {
height : true ,
} ,
widgetSize : [
{
viewportMinWidth : 0 ,
configuration : ( ) = > {
return {
minWidth : "160px" ,
} ;
} ,
} ,
] ,
disableResizeHandles : {
vertical : true ,
} ,
} ;
}
2023-08-10 05:21:19 +00:00
2023-09-06 12:15:04 +00:00
static getMethods() {
2023-08-10 05:21:19 +00:00
return {
2023-09-06 12:15:04 +00:00
getQueryGenerationConfig ( widget : WidgetProps ) {
return {
select : {
where : ` ${ widget . widgetName } .filterText ` ,
} ,
} ;
} ,
getPropertyUpdatesForQueryBinding (
queryConfig : WidgetQueryConfig ,
widget : WidgetProps ,
formConfig : WidgetQueryGenerationFormConfig ,
) {
let modify ;
if ( queryConfig . select ) {
modify = {
sourceData : queryConfig.select.data ,
optionLabel : formConfig.aliases.find ( ( d ) = > d . name === "label" )
? . alias ,
optionValue : formConfig.aliases.find ( ( d ) = > d . name === "value" )
? . alias ,
defaultOptionValue : "" ,
serverSideFiltering : true ,
onFilterUpdate : queryConfig.select.run ,
} ;
}
return {
modify ,
} ;
} ,
2023-08-10 05:21:19 +00:00
} ;
}
2023-04-14 06:27:49 +00:00
static getAutocompleteDefinitions ( ) : AutocompletionDefinitions {
return {
"!doc" :
"MultiSelect is used to capture user input/s from a specified list of permitted inputs. A MultiSelect captures multiple choices from a list of options" ,
"!url" : "https://docs.appsmith.com/widget-reference/dropdown" ,
isVisible : DefaultAutocompleteDefinitions.isVisible ,
filterText : {
"!type" : "string" ,
"!doc" : "The filter text for Server side filtering" ,
} ,
selectedOptionValues : {
"!type" : "[string]" ,
"!doc" : "The array of values selected in a multi select dropdown" ,
"!url" : "https://docs.appsmith.com/widget-reference/dropdown" ,
} ,
selectedOptionLabels : {
"!type" : "[string]" ,
"!doc" :
"The array of selected option labels in a multi select dropdown" ,
"!url" : "https://docs.appsmith.com/widget-reference/dropdown" ,
} ,
isDisabled : "bool" ,
isValid : "bool" ,
isDirty : "bool" ,
options : "[$__dropdownOption__$]" ,
} ;
}
2022-08-15 07:38:30 +00:00
static getPropertyPaneContentConfig() {
return [
{
sectionName : "Data" ,
children : [
{
helpText :
2023-07-25 04:56:33 +00:00
"Takes in an array of objects to display options. Bind data from an API using {{}}" ,
propertyName : "sourceData" ,
label : "Source Data" ,
2023-08-10 05:21:19 +00:00
controlType : "ONE_CLICK_BINDING_CONTROL" ,
controlConfig : {
aliases : [
{
name : "label" ,
isSearcheable : true ,
isRequired : true ,
} ,
{
name : "value" ,
isRequired : true ,
} ,
] ,
sampleData : JSON.stringify (
[
{ name : "Blue" , code : "BLUE" } ,
{ name : "Green" , code : "GREEN" } ,
{ name : "Red" , code : "RED" } ,
] ,
null ,
2 ,
) ,
} ,
isJSConvertible : true ,
2022-08-15 07:38:30 +00:00
placeholderText : '[{ "label": "Option1", "value": "Option2" }]' ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : {
type : ValidationTypes . ARRAY ,
params : {
children : {
type : ValidationTypes . OBJECT ,
params : {
required : true ,
} ,
} ,
} ,
} ,
evaluationSubstitutionType :
EvaluationSubstitutionType . SMART_SUBSTITUTE ,
} ,
2023-07-25 04:56:33 +00:00
{
2023-08-10 05:21:19 +00:00
helpText :
"Choose or set a field from source data as the display label" ,
2023-07-25 04:56:33 +00:00
propertyName : "optionLabel" ,
2023-08-10 05:21:19 +00:00
label : "Label key" ,
2023-07-25 04:56:33 +00:00
controlType : "DROP_DOWN" ,
customJSControl : "WRAPPED_CODE_EDITOR" ,
controlConfig : {
wrapperCode : {
prefix : getOptionLabelValueExpressionPrefix ,
suffix : optionLabelValueExpressionSuffix ,
} ,
} ,
placeholderText : "" ,
isBindProperty : true ,
isTriggerProperty : false ,
isJSConvertible : true ,
evaluatedDependencies : [ "sourceData" ] ,
options : getLabelValueKeyOptions ,
alwaysShowSelected : true ,
validation : {
type : ValidationTypes . FUNCTION ,
params : {
fn : labelKeyValidation ,
expected : {
type : "String or Array<string>" ,
example : ` color | ["blue", "green"] ` ,
autocompleteDataType : AutocompleteDataType.STRING ,
} ,
} ,
} ,
additionalAutoComplete : getLabelValueAdditionalAutocompleteData ,
} ,
{
2023-08-10 05:21:19 +00:00
helpText : "Choose or set a field from source data as the value" ,
2023-07-25 04:56:33 +00:00
propertyName : "optionValue" ,
2023-08-10 05:21:19 +00:00
label : "Value key" ,
2023-07-25 04:56:33 +00:00
controlType : "DROP_DOWN" ,
customJSControl : "WRAPPED_CODE_EDITOR" ,
controlConfig : {
wrapperCode : {
prefix : getOptionLabelValueExpressionPrefix ,
suffix : optionLabelValueExpressionSuffix ,
} ,
} ,
placeholderText : "" ,
isBindProperty : true ,
isTriggerProperty : false ,
isJSConvertible : true ,
evaluatedDependencies : [ "sourceData" ] ,
options : getLabelValueKeyOptions ,
alwaysShowSelected : true ,
validation : {
type : ValidationTypes . FUNCTION ,
params : {
fn : valueKeyValidation ,
expected : {
type : "String or Array<string | number | boolean>" ,
example : ` color | [1, "orange"] ` ,
autocompleteDataType : AutocompleteDataType.STRING ,
} ,
} ,
dependentPaths : [ "sourceData" ] ,
} ,
additionalAutoComplete : getLabelValueAdditionalAutocompleteData ,
} ,
2022-08-15 07:38:30 +00:00
{
helpText : "Selects the option(s) with value by default" ,
propertyName : "defaultOptionValue" ,
2023-05-19 18:37:06 +00:00
label : "Default selected values" ,
2023-07-25 04:56:33 +00:00
controlType : "WRAPPED_CODE_EDITOR" ,
controlConfig : {
wrapperCode : {
prefix : defaultValueExpressionPrefix ,
suffix : getDefaultValueExpressionSuffix ,
} ,
} ,
2022-08-15 07:38:30 +00:00
placeholderText : "[GREEN]" ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : {
type : ValidationTypes . FUNCTION ,
params : {
fn : defaultOptionValueValidation ,
expected : {
type : "Array of values" ,
example : ` "option1, option2" | ['option1', 'option2'] | [{ "label": "label1", "value": "value1" }] ` ,
autocompleteDataType : AutocompleteDataType.ARRAY ,
} ,
} ,
2023-07-25 04:56:33 +00:00
dependentPaths : [ "serverSideFiltering" , "options" ] ,
2022-08-15 07:38:30 +00:00
} ,
2022-09-05 04:52:39 +00:00
dependencies : [ "serverSideFiltering" , "options" ] ,
2022-08-15 07:38:30 +00:00
} ,
] ,
} ,
{
sectionName : "Label" ,
children : [
{
helpText : "Sets the label text of the widget" ,
propertyName : "labelText" ,
label : "Text" ,
controlType : "INPUT_TEXT" ,
placeholderText : "Enter label text" ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . TEXT } ,
} ,
{
helpText : "Sets the label position of the widget" ,
propertyName : "labelPosition" ,
label : "Position" ,
2022-10-20 14:06:32 +00:00
controlType : "ICON_TABS" ,
fullWidth : true ,
2023-04-07 13:51:35 +00:00
hidden : isAutoLayout ,
2022-08-15 07:38:30 +00:00
options : [
2022-10-20 14:06:32 +00:00
{ label : "Auto" , value : LabelPosition.Auto } ,
2022-08-15 07:38:30 +00:00
{ label : "Left" , value : LabelPosition.Left } ,
{ label : "Top" , value : LabelPosition.Top } ,
] ,
2022-11-23 09:48:23 +00:00
defaultValue : LabelPosition.Top ,
2022-08-15 07:38:30 +00:00
isBindProperty : false ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . TEXT } ,
} ,
{
helpText : "Sets the label alignment of the widget" ,
propertyName : "labelAlignment" ,
label : "Alignment" ,
controlType : "LABEL_ALIGNMENT_OPTIONS" ,
2023-05-19 18:37:06 +00:00
fullWidth : false ,
2022-08-15 07:38:30 +00:00
options : [
{
2023-05-19 18:37:06 +00:00
startIcon : "align-left" ,
2022-08-15 07:38:30 +00:00
value : Alignment.LEFT ,
} ,
{
2023-05-19 18:37:06 +00:00
startIcon : "align-right" ,
2022-08-15 07:38:30 +00:00
value : Alignment.RIGHT ,
} ,
] ,
isBindProperty : false ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . TEXT } ,
hidden : ( props : MultiSelectWidgetProps ) = >
props . labelPosition !== LabelPosition . Left ,
dependencies : [ "labelPosition" ] ,
} ,
{
helpText :
"Sets the label width of the widget as the number of columns" ,
propertyName : "labelWidth" ,
label : "Width (in columns)" ,
controlType : "NUMERIC_INPUT" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : false ,
min : 0 ,
validation : {
type : ValidationTypes . NUMBER ,
params : {
natural : true ,
} ,
} ,
hidden : ( props : MultiSelectWidgetProps ) = >
props . labelPosition !== LabelPosition . Left ,
dependencies : [ "labelPosition" ] ,
} ,
] ,
} ,
{
2023-05-19 18:37:06 +00:00
sectionName : "Search & filters" ,
2022-08-15 07:38:30 +00:00
children : [
{
propertyName : "isFilterable" ,
2023-05-19 18:37:06 +00:00
label : "Allow searching" ,
2022-08-15 07:38:30 +00:00
helpText : "Makes the dropdown list filterable" ,
controlType : "SWITCH" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . BOOLEAN } ,
} ,
{
helpText : "Enables server side filtering of the data" ,
propertyName : "serverSideFiltering" ,
2023-05-19 18:37:06 +00:00
label : "Server side filtering" ,
2022-08-15 07:38:30 +00:00
controlType : "SWITCH" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . BOOLEAN } ,
} ,
{
helpText : "Trigger an action on change of filterText" ,
hidden : ( props : MultiSelectWidgetProps ) = >
! props . serverSideFiltering ,
dependencies : [ "serverSideFiltering" ] ,
propertyName : "onFilterUpdate" ,
label : "onFilterUpdate" ,
controlType : "ACTION_SELECTOR" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : true ,
} ,
] ,
} ,
{
sectionName : "Validations" ,
children : [
{
propertyName : "isRequired" ,
label : "Required" ,
helpText : "Makes input to the widget mandatory" ,
controlType : "SWITCH" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . BOOLEAN } ,
} ,
] ,
} ,
{
sectionName : "General" ,
children : [
2022-12-03 11:58:02 +00:00
{
2022-12-13 10:35:08 +00:00
helpText : "Show help text or details about current selection" ,
2022-12-03 11:58:02 +00:00
propertyName : "labelTooltip" ,
label : "Tooltip" ,
controlType : "INPUT_TEXT" ,
2022-12-13 10:35:08 +00:00
placeholderText : "Add tooltip text here" ,
2022-12-03 11:58:02 +00:00
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . TEXT } ,
} ,
2022-08-15 07:38:30 +00:00
{
helpText : "Sets a Placeholder Text" ,
propertyName : "placeholderText" ,
label : "Placeholder" ,
controlType : "INPUT_TEXT" ,
placeholderText : "Search" ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . TEXT } ,
} ,
{
helpText : "Controls the visibility of the widget" ,
propertyName : "isVisible" ,
label : "Visible" ,
controlType : "SWITCH" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . BOOLEAN } ,
} ,
{
propertyName : "isDisabled" ,
label : "Disabled" ,
helpText : "Disables input to this widget" ,
controlType : "SWITCH" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . BOOLEAN } ,
} ,
{
propertyName : "animateLoading" ,
2023-05-19 18:37:06 +00:00
label : "Animate loading" ,
2022-08-15 07:38:30 +00:00
controlType : "SWITCH" ,
helpText : "Controls the loading of the widget" ,
defaultValue : true ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . BOOLEAN } ,
} ,
{
helpText :
"Controls the visibility of select all option in dropdown." ,
propertyName : "allowSelectAll" ,
2023-05-19 18:37:06 +00:00
label : "Allow select all" ,
2022-08-15 07:38:30 +00:00
controlType : "SWITCH" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . BOOLEAN } ,
} ,
] ,
} ,
{
sectionName : "Events" ,
children : [
{
2023-04-06 16:49:12 +00:00
helpText : "when a user selects an option" ,
2022-08-15 07:38:30 +00:00
propertyName : "onOptionChange" ,
label : "onOptionChange" ,
controlType : "ACTION_SELECTOR" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : true ,
} ,
2022-12-12 07:09:22 +00:00
{
2023-04-06 16:49:12 +00:00
helpText : "when the dropdown opens" ,
2022-12-12 07:09:22 +00:00
propertyName : "onDropdownOpen" ,
label : "onDropdownOpen" ,
controlType : "ACTION_SELECTOR" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : true ,
} ,
{
2023-04-06 16:49:12 +00:00
helpText : "when the dropdown closes" ,
2022-12-12 07:09:22 +00:00
propertyName : "onDropdownClose" ,
label : "onDropdownClose" ,
controlType : "ACTION_SELECTOR" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : true ,
} ,
2022-08-15 07:38:30 +00:00
] ,
} ,
] ;
}
static getPropertyPaneStyleConfig() {
return [
{
2023-05-19 18:37:06 +00:00
sectionName : "Label styles" ,
2022-08-15 07:38:30 +00:00
children : [
{
propertyName : "labelTextColor" ,
2023-05-19 18:37:06 +00:00
label : "Font color" ,
2022-10-20 14:06:32 +00:00
helpText : "Control the color of the label associated" ,
2022-08-15 07:38:30 +00:00
controlType : "COLOR_PICKER" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . TEXT } ,
} ,
{
propertyName : "labelTextSize" ,
2023-05-19 18:37:06 +00:00
label : "Font size" ,
2022-10-20 14:06:32 +00:00
helpText : "Control the font size of the label associated" ,
2022-08-15 07:38:30 +00:00
controlType : "DROP_DOWN" ,
defaultValue : "0.875rem" ,
2023-04-07 13:51:35 +00:00
hidden : isAutoLayout ,
2022-08-15 07:38:30 +00:00
options : [
{
label : "S" ,
value : "0.875rem" ,
subText : "0.875rem" ,
} ,
{
label : "M" ,
value : "1rem" ,
subText : "1rem" ,
} ,
{
label : "L" ,
value : "1.25rem" ,
subText : "1.25rem" ,
} ,
{
label : "XL" ,
value : "1.875rem" ,
subText : "1.875rem" ,
} ,
{
label : "2xl" ,
value : "3rem" ,
subText : "3rem" ,
} ,
{
label : "3xl" ,
value : "3.75rem" ,
subText : "3.75rem" ,
} ,
] ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . TEXT } ,
} ,
{
propertyName : "labelStyle" ,
label : "Emphasis" ,
2022-10-20 14:06:32 +00:00
helpText : "Control if the label should be bold or italics" ,
2022-12-29 11:08:13 +00:00
controlType : "BUTTON_GROUP" ,
2022-08-15 07:38:30 +00:00
options : [
{
2023-05-19 18:37:06 +00:00
icon : "text-bold" ,
2022-08-15 07:38:30 +00:00
value : "BOLD" ,
} ,
{
2023-05-19 18:37:06 +00:00
icon : "text-italic" ,
2022-08-15 07:38:30 +00:00
value : "ITALIC" ,
} ,
] ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . TEXT } ,
} ,
] ,
} ,
{
2023-05-19 18:37:06 +00:00
sectionName : "Border and shadow" ,
2022-08-15 07:38:30 +00:00
children : [
{
propertyName : "borderRadius" ,
2023-05-19 18:37:06 +00:00
label : "Border radius" ,
2022-08-15 07:38:30 +00:00
helpText :
"Rounds the corners of the icon button's outer border edge" ,
controlType : "BORDER_RADIUS_OPTIONS" ,
isBindProperty : true ,
isJSConvertible : true ,
isTriggerProperty : false ,
validation : {
type : ValidationTypes . TEXT ,
2022-05-04 09:45:57 +00:00
} ,
} ,
{
propertyName : "boxShadow" ,
2023-05-19 18:37:06 +00:00
label : "Box shadow" ,
2022-05-04 09:45:57 +00:00
helpText :
"Enables you to cast a drop shadow from the frame of the widget" ,
controlType : "BOX_SHADOW_OPTIONS" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . TEXT } ,
} ,
{
propertyName : "accentColor" ,
2023-05-19 18:37:06 +00:00
label : "Accent color" ,
2022-05-04 09:45:57 +00:00
controlType : "COLOR_PICKER" ,
isJSConvertible : true ,
isBindProperty : true ,
isTriggerProperty : false ,
validation : { type : ValidationTypes . TEXT } ,
invisible : true ,
} ,
2022-02-02 14:15:07 +00:00
] ,
} ,
] ;
}
2022-11-28 04:44:31 +00:00
static getStylesheetConfig ( ) : Stylesheet {
return {
accentColor : "{{appsmith.theme.colors.primaryColor}}" ,
borderRadius : "{{appsmith.theme.borderRadius.appBorderRadius}}" ,
boxShadow : "none" ,
} ;
}
2022-02-02 14:15:07 +00:00
static getDerivedPropertiesMap() {
return {
2023-07-25 04:56:33 +00:00
options : ` {{(()=>{ ${ derivedProperties . getOptions } })()}} ` ,
2022-04-08 13:07:10 +00:00
value : ` {{this.selectedOptionValues}} ` ,
2022-08-03 13:17:07 +00:00
isValid : ` {{(()=>{ ${ derivedProperties . getIsValid } })()}} ` ,
selectedOptionValues : ` {{(()=>{ ${ derivedProperties . getSelectedOptionValues } })()}} ` ,
selectedOptionLabels : ` {{(()=>{ ${ derivedProperties . getSelectedOptionLabels } })()}} ` ,
2022-02-02 14:15:07 +00:00
} ;
}
static getDefaultPropertiesMap ( ) : Record < string , string > {
return {
selectedOptions : "defaultOptionValue" ,
} ;
}
static getMetaPropertiesMap ( ) : Record < string , any > {
return {
selectedOptions : undefined ,
filterText : "" ,
2022-03-01 19:02:10 +00:00
isDirty : false ,
2022-02-02 14:15:07 +00:00
} ;
}
2022-03-01 19:02:10 +00:00
componentDidUpdate ( prevProps : MultiSelectWidgetProps ) : void {
2022-03-16 14:44:44 +00:00
// Check if defaultOptionValue is string
let isStringArray = false ;
2022-03-01 19:02:10 +00:00
if (
2022-08-19 10:10:36 +00:00
this . props . defaultOptionValue &&
2022-03-16 14:44:44 +00:00
this . props . defaultOptionValue . some (
( value : any ) = > isString ( value ) || isFinite ( value ) ,
)
2022-03-01 19:02:10 +00:00
) {
2022-03-16 14:44:44 +00:00
isStringArray = true ;
}
const hasChanges = isStringArray
? xorWith (
this . props . defaultOptionValue as string [ ] ,
prevProps . defaultOptionValue as string [ ] ,
2022-09-02 09:16:30 +00:00
equal ,
2022-03-16 14:44:44 +00:00
) . length > 0
: xorWith (
this . props . defaultOptionValue as OptionValue [ ] ,
prevProps . defaultOptionValue as OptionValue [ ] ,
2022-09-02 09:16:30 +00:00
equal ,
2022-03-16 14:44:44 +00:00
) . length > 0 ;
if ( hasChanges && this . props . isDirty ) {
2022-03-01 19:02:10 +00:00
this . props . updateWidgetMetaProperty ( "isDirty" , false ) ;
}
}
2023-07-08 14:07:26 +00:00
static getSetterConfig ( ) : SetterConfig {
return {
__setters : {
setVisibility : {
path : "isVisible" ,
type : "boolean" ,
} ,
setDisabled : {
path : "isDisabled" ,
type : "boolean" ,
} ,
setRequired : {
path : "isRequired" ,
type : "boolean" ,
} ,
setSelectedOptions : {
path : "defaultOptionValue" ,
type : "array" ,
2023-07-24 06:53:45 +00:00
accessor : "selectedOptionValues" ,
2023-07-08 14:07:26 +00:00
} ,
} ,
} ;
}
2023-09-11 15:55:11 +00:00
getWidgetView() {
2022-02-02 14:15:07 +00:00
const options = isArray ( this . props . options ) ? this . props . options : [ ] ;
2022-04-04 05:12:33 +00:00
const minDropDownWidth = MinimumPopupRows * this . props . parentColumnSpace ;
2023-09-11 15:55:11 +00:00
const { componentWidth } = this . props ;
2022-08-03 13:17:07 +00:00
const values = this . mergeLabelAndValue ( ) ;
2022-03-11 05:35:05 +00:00
const isInvalid =
"isValid" in this . props && ! this . props . isValid && ! ! this . props . isDirty ;
2022-02-02 14:15:07 +00:00
return (
< MultiSelectComponent
2022-05-04 09:45:57 +00:00
accentColor = { this . props . accentColor }
2022-02-02 14:15:07 +00:00
allowSelectAll = { this . props . allowSelectAll }
2022-05-04 09:45:57 +00:00
borderRadius = { this . props . borderRadius }
boxShadow = { this . props . boxShadow }
2022-02-02 14:15:07 +00:00
compactMode = {
! (
( this . props . bottomRow - this . props . topRow ) /
GRID_DENSITY_MIGRATION_V1 >
1
)
}
disabled = { this . props . isDisabled ? ? false }
2022-04-04 05:12:33 +00:00
dropDownWidth = { minDropDownWidth }
2022-02-02 14:15:07 +00:00
dropdownStyle = { {
zIndex : Layers.dropdownModalWidget ,
} }
filterText = { this . props . filterText }
2022-11-23 09:48:23 +00:00
isDynamicHeightEnabled = { isAutoHeightEnabledForWidget ( this . props ) }
2022-02-02 14:15:07 +00:00
isFilterable = { this . props . isFilterable }
2022-03-11 05:35:05 +00:00
isValid = { ! isInvalid }
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600)
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Create a new property control for a label position
-- Create a new property control for a label alignment
-- Prototype a label section for Input widget
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Add a property, labelWidth in the property pane
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Input widget: Implement all the requirements in case its type is Text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adapt the functionalty on other types of the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into DropdownWidget
-- Clean up for the input widget and DRY
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectWidget
-- Eliminate unnecessary component prop, columns
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalties into Tree Select widget
-- Add styles for alignment between lable and input control over the widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectTreeWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Introduce label functionalities into DatePickerWidget2
-- Use width instead of columns prop in InputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RichTextEditorWidget
-- Eliminate compactMode from StyledLabel
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into CheckboxGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement switch group for the correct meaning of right alignment
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RadioGroupWidget
-- Add new properties, alignment and inline for consistency
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adjust cols and rows for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused StyledRadioProps
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete first MVP of enhanced SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete the first MVP of enhanced RadioGroupWidget
-- Eliminate unused StyledSwitch component for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add min-height, align-self rules for LabelContainer
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Use original label property for RadioGroupWidget
-- Add a migration for adding isInline and alignment properties for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Update version to latest one in DSLMigrationsUtils.test.ts
* fix failing jest test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DSLMigrationsUtils
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the label related test case which is failed in Input_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on #10119: The label text truncates on resizing the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget
* fix: Widget Popup test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement width and alginment features on the level of label element
-- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing
-- Enable label feature on a RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set label container's default width to 33% when width is not set
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set flex-grow to zero on input types other than TEXT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label features on newly created MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate LabelPositionTypes, directly using enum LabelPosition
-- Add a comment for a constant LABEL_MAX_WIDTH_RATE
-- Directly import React for LabelAlignmentOptionsControl
-- Remove unnecessary constructor for LabelAlignmentOptionsControl
-- Define handleAlign instance method as a higher-order function
-- Only migrate alignment property for RadioGroupWidget
-- Use Object.hasOwnProperty instead of in operator
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Revert currentDSL.version to 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a Jest test case for RadioGroupWidget's alignment property migration
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Replace all nested ternary operators with if statements
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label feature on new version of SelectWidget
-- Add Cypress tests for widgets' label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor code for BaseInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change CSS selector for step buttons for Numeric BaseInputWidget
-- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on typo about migrateRadioGroupAlignmentProperty
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add data-testid attributes for Cypress selectors
* feat: Deprecate form button widget
-- Assert flex-direction to row in CheckboxGroup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a missing data-testid for SelectWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2
* fix: Select popup DSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new property control, NumericInputControl
-- Replace all the label properties with the newly created controls
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new Cypress command, checkLabelWidth and apply to all related test cases
-- Increase width in checkboxgroupDsl.json
-- Rename className for label in MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement the tooltip feature for labels
-- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency
-- Apply default values into label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract the label related parts from the various widgets as an independent component
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate TypeScript any type from BaseInputComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change labelPosition property type to DROP_DOWN
-- Modify LabelAlignmentOptionsControl to use ButtonTabComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Define getLabelWidth method into BaseWidget
-- Extract the common CSS rules for the widget containers
-- Revert rows and columns for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed test case in DSLMigrationsUtils.test.ts
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on overflow issue on CheckboxGroupWidget
-- Create a distinctive spec file for label feature
-- Eliminate the redundant label specs with the relevant widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx
-- Revise wrong comment for checkLabelForWidget Cypress command
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Do not set the label width only if its value is 0
-- Clean up the component for DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Make RadioGroupWidget's layout flexible in all modes
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec
-- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change getLabelWidth method to not have any argument
-- Define some constants for label numbers
-- Extract the common styles for SwitchGroupWidget and RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor some constants
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused width prop from RadioGroupWidget
-- Get labelWidth from getLabelWidth
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate the min-height restriction on a label
-- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add one more condition checking if the current input type is text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2
-- Apply a few CSS fixes on the scrollbar issue select related widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply some tweaks for earlier widgets with labels so as not to be broken UX
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed Cypress test case in Widget_Popup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set the font size to 14px for NumericInputControl
Co-authored-by: ohansFavour <fohanekwu@gmail.com>
Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
labelAlignment = { this . props . labelAlignment }
labelPosition = { this . props . labelPosition }
2022-02-02 14:15:07 +00:00
labelStyle = { this . props . labelStyle }
labelText = { this . props . labelText }
labelTextColor = { this . props . labelTextColor }
labelTextSize = { this . props . labelTextSize }
2022-12-03 11:58:02 +00:00
labelTooltip = { this . props . labelTooltip }
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600)
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Create a new property control for a label position
-- Create a new property control for a label alignment
-- Prototype a label section for Input widget
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Add a property, labelWidth in the property pane
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Input widget: Implement all the requirements in case its type is Text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adapt the functionalty on other types of the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into DropdownWidget
-- Clean up for the input widget and DRY
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectWidget
-- Eliminate unnecessary component prop, columns
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalties into Tree Select widget
-- Add styles for alignment between lable and input control over the widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectTreeWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Introduce label functionalities into DatePickerWidget2
-- Use width instead of columns prop in InputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RichTextEditorWidget
-- Eliminate compactMode from StyledLabel
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into CheckboxGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement switch group for the correct meaning of right alignment
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RadioGroupWidget
-- Add new properties, alignment and inline for consistency
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adjust cols and rows for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused StyledRadioProps
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete first MVP of enhanced SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete the first MVP of enhanced RadioGroupWidget
-- Eliminate unused StyledSwitch component for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add min-height, align-self rules for LabelContainer
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Use original label property for RadioGroupWidget
-- Add a migration for adding isInline and alignment properties for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Update version to latest one in DSLMigrationsUtils.test.ts
* fix failing jest test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DSLMigrationsUtils
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the label related test case which is failed in Input_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on #10119: The label text truncates on resizing the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget
* fix: Widget Popup test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement width and alginment features on the level of label element
-- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing
-- Enable label feature on a RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set label container's default width to 33% when width is not set
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set flex-grow to zero on input types other than TEXT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label features on newly created MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate LabelPositionTypes, directly using enum LabelPosition
-- Add a comment for a constant LABEL_MAX_WIDTH_RATE
-- Directly import React for LabelAlignmentOptionsControl
-- Remove unnecessary constructor for LabelAlignmentOptionsControl
-- Define handleAlign instance method as a higher-order function
-- Only migrate alignment property for RadioGroupWidget
-- Use Object.hasOwnProperty instead of in operator
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Revert currentDSL.version to 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a Jest test case for RadioGroupWidget's alignment property migration
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Replace all nested ternary operators with if statements
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label feature on new version of SelectWidget
-- Add Cypress tests for widgets' label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor code for BaseInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change CSS selector for step buttons for Numeric BaseInputWidget
-- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on typo about migrateRadioGroupAlignmentProperty
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add data-testid attributes for Cypress selectors
* feat: Deprecate form button widget
-- Assert flex-direction to row in CheckboxGroup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a missing data-testid for SelectWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2
* fix: Select popup DSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new property control, NumericInputControl
-- Replace all the label properties with the newly created controls
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new Cypress command, checkLabelWidth and apply to all related test cases
-- Increase width in checkboxgroupDsl.json
-- Rename className for label in MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement the tooltip feature for labels
-- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency
-- Apply default values into label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract the label related parts from the various widgets as an independent component
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate TypeScript any type from BaseInputComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change labelPosition property type to DROP_DOWN
-- Modify LabelAlignmentOptionsControl to use ButtonTabComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Define getLabelWidth method into BaseWidget
-- Extract the common CSS rules for the widget containers
-- Revert rows and columns for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed test case in DSLMigrationsUtils.test.ts
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on overflow issue on CheckboxGroupWidget
-- Create a distinctive spec file for label feature
-- Eliminate the redundant label specs with the relevant widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx
-- Revise wrong comment for checkLabelForWidget Cypress command
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Do not set the label width only if its value is 0
-- Clean up the component for DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Make RadioGroupWidget's layout flexible in all modes
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec
-- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change getLabelWidth method to not have any argument
-- Define some constants for label numbers
-- Extract the common styles for SwitchGroupWidget and RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor some constants
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused width prop from RadioGroupWidget
-- Get labelWidth from getLabelWidth
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate the min-height restriction on a label
-- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add one more condition checking if the current input type is text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2
-- Apply a few CSS fixes on the scrollbar issue select related widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply some tweaks for earlier widgets with labels so as not to be broken UX
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed Cypress test case in Widget_Popup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set the font size to 14px for NumericInputControl
Co-authored-by: ohansFavour <fohanekwu@gmail.com>
Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
labelWidth = { this . getLabelWidth ( ) }
2022-02-02 14:15:07 +00:00
loading = { this . props . isLoading }
onChange = { this . onOptionChange }
2022-12-12 07:09:22 +00:00
onDropdownClose = { this . onDropdownClose }
onDropdownOpen = { this . onDropdownOpen }
2022-02-02 14:15:07 +00:00
onFilterChange = { this . onFilterChange }
options = { options }
placeholder = { this . props . placeholderText as string }
2022-06-08 05:32:28 +00:00
renderMode = { this . props . renderMode }
2022-02-02 14:15:07 +00:00
serverSideFiltering = { this . props . serverSideFiltering }
2022-02-22 08:43:35 +00:00
value = { values }
2022-02-02 14:15:07 +00:00
widgetId = { this . props . widgetId }
width = { componentWidth }
/ >
) ;
}
2022-08-18 10:30:37 +00:00
onOptionChange = ( value : DraftValueType ) = > {
2022-02-02 14:15:07 +00:00
this . props . updateWidgetMetaProperty ( "selectedOptions" , value , {
triggerPropertyName : "onOptionChange" ,
dynamicString : this.props.onOptionChange ,
event : {
type : EventType . ON_OPTION_CHANGE ,
} ,
} ) ;
2022-03-11 05:35:05 +00:00
if ( ! this . props . isDirty ) {
this . props . updateWidgetMetaProperty ( "isDirty" , true ) ;
}
2022-02-02 14:15:07 +00:00
} ;
2022-08-03 13:17:07 +00:00
// { label , value } is needed in the widget
2022-08-18 10:30:37 +00:00
mergeLabelAndValue = ( ) : LabelInValueType [ ] = > {
2022-12-01 19:06:49 +00:00
if ( ! this . props . selectedOptionLabels || ! this . props . selectedOptionValues ) {
return [ ] ;
}
2022-08-03 13:17:07 +00:00
const labels = [ . . . this . props . selectedOptionLabels ] ;
const values = [ . . . this . props . selectedOptionValues ] ;
return values . map ( ( value , index ) = > ( {
value ,
label : labels [ index ] ,
} ) ) ;
} ;
2022-02-02 14:15:07 +00:00
onFilterChange = ( value : string ) = > {
this . props . updateWidgetMetaProperty ( "filterText" , value ) ;
if ( this . props . onFilterUpdate && this . props . serverSideFiltering ) {
super . executeAction ( {
triggerPropertyName : "onFilterUpdate" ,
dynamicString : this.props.onFilterUpdate ,
event : {
type : EventType . ON_FILTER_UPDATE ,
} ,
} ) ;
}
} ;
2022-12-12 07:09:22 +00:00
onDropdownOpen = ( ) = > {
if ( this . props . onDropdownOpen ) {
super . executeAction ( {
triggerPropertyName : "onDropdownOpen" ,
dynamicString : this.props.onDropdownOpen ,
event : {
type : EventType . ON_DROPDOWN_OPEN ,
} ,
} ) ;
}
} ;
onDropdownClose = ( ) = > {
if ( this . props . onDropdownClose ) {
super . executeAction ( {
triggerPropertyName : "onDropdownClose" ,
dynamicString : this.props.onDropdownClose ,
event : {
type : EventType . ON_DROPDOWN_CLOSE ,
} ,
} ) ;
}
} ;
2022-02-02 14:15:07 +00:00
}
2022-03-11 05:35:05 +00:00
export interface OptionValue {
2022-02-02 14:15:07 +00:00
label : string ;
value : string ;
2022-03-11 05:35:05 +00:00
}
export interface DropdownOption extends OptionValue {
2022-02-02 14:15:07 +00:00
disabled? : boolean ;
}
export interface MultiSelectWidgetProps extends WidgetProps {
placeholderText? : string ;
selectedIndex? : number ;
selectedIndexArr? : number [ ] ;
selectedOption : DropdownOption ;
options? : DropdownOption [ ] ;
onOptionChange : string ;
onFilterChange : string ;
2022-12-12 07:09:22 +00:00
onDropdownOpen? : string ;
onDropdownClose? : string ;
2022-03-16 14:44:44 +00:00
defaultOptionValue : string [ ] | OptionValue [ ] ;
2022-02-02 14:15:07 +00:00
isRequired : boolean ;
isLoading : boolean ;
2022-08-18 10:30:37 +00:00
selectedOptions : LabelInValueType [ ] ;
2022-02-02 14:15:07 +00:00
filterText : string ;
2022-12-01 19:06:49 +00:00
selectedOptionValues? : string [ ] ;
selectedOptionLabels? : string [ ] ;
2022-02-02 14:15:07 +00:00
serverSideFiltering : boolean ;
onFilterUpdate : string ;
allowSelectAll? : boolean ;
isFilterable : boolean ;
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600)
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Create a new property control for a label position
-- Create a new property control for a label alignment
-- Prototype a label section for Input widget
* feat: When there are multiple input widgets with different label lengths then the input box looks misaligned
-- Add a property, labelWidth in the property pane
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Input widget: Implement all the requirements in case its type is Text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adapt the functionalty on other types of the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into DropdownWidget
-- Clean up for the input widget and DRY
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectWidget
-- Eliminate unnecessary component prop, columns
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalties into Tree Select widget
-- Add styles for alignment between lable and input control over the widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add label functionalities into MultiSelectTreeWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Introduce label functionalities into DatePickerWidget2
-- Use width instead of columns prop in InputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RichTextEditorWidget
-- Eliminate compactMode from StyledLabel
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into CheckboxGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement switch group for the correct meaning of right alignment
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply label functionalities into RadioGroupWidget
-- Add new properties, alignment and inline for consistency
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Adjust cols and rows for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused StyledRadioProps
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete first MVP of enhanced SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Complete the first MVP of enhanced RadioGroupWidget
-- Eliminate unused StyledSwitch component for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add min-height, align-self rules for LabelContainer
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Use original label property for RadioGroupWidget
-- Add a migration for adding isInline and alignment properties for RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Update version to latest one in DSLMigrationsUtils.test.ts
* fix failing jest test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DSLMigrationsUtils
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the label related test case which is failed in Input_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on #10119: The label text truncates on resizing the input widget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget
* fix: Widget Popup test
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement width and alginment features on the level of label element
-- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing
-- Enable label feature on a RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set label container's default width to 33% when width is not set
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set flex-grow to zero on input types other than TEXT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label features on newly created MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate LabelPositionTypes, directly using enum LabelPosition
-- Add a comment for a constant LABEL_MAX_WIDTH_RATE
-- Directly import React for LabelAlignmentOptionsControl
-- Remove unnecessary constructor for LabelAlignmentOptionsControl
-- Define handleAlign instance method as a higher-order function
-- Only migrate alignment property for RadioGroupWidget
-- Use Object.hasOwnProperty instead of in operator
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Revert currentDSL.version to 52
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a Jest test case for RadioGroupWidget's alignment property migration
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Replace all nested ternary operators with if statements
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Implement label feature on new version of SelectWidget
-- Add Cypress tests for widgets' label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor code for BaseInputWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change CSS selector for step buttons for Numeric BaseInputWidget
-- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on typo about migrateRadioGroupAlignmentProperty
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add data-testid attributes for Cypress selectors
* feat: Deprecate form button widget
-- Assert flex-direction to row in CheckboxGroup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add a missing data-testid for SelectWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2
* fix: Select popup DSL
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new property control, NumericInputControl
-- Replace all the label properties with the newly created controls
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Create a new Cypress command, checkLabelWidth and apply to all related test cases
-- Increase width in checkboxgroupDsl.json
-- Rename className for label in MultiSelectWidgetV2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Reimplement the tooltip feature for labels
-- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency
-- Apply default values into label section
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract the label related parts from the various widgets as an independent component
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate TypeScript any type from BaseInputComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change labelPosition property type to DROP_DOWN
-- Modify LabelAlignmentOptionsControl to use ButtonTabComponent
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Define getLabelWidth method into BaseWidget
-- Extract the common CSS rules for the widget containers
-- Revert rows and columns for SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed test case in DSLMigrationsUtils.test.ts
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on overflow issue on CheckboxGroupWidget
-- Create a distinctive spec file for label feature
-- Eliminate the redundant label specs with the relevant widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx
-- Revise wrong comment for checkLabelForWidget Cypress command
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Do not set the label width only if its value is 0
-- Clean up the component for DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused imports in DatePickerWidget2
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Make RadioGroupWidget's layout flexible in all modes
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec
-- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Change getLabelWidth method to not have any argument
-- Define some constants for label numbers
-- Extract the common styles for SwitchGroupWidget and RadioGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Refactor some constants
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate unused width prop from RadioGroupWidget
-- Get labelWidth from getLabelWidth
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Eliminate the min-height restriction on a label
-- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add one more condition checking if the current input type is text
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2
-- Apply a few CSS fixes on the scrollbar issue select related widgets
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Apply some tweaks for earlier widgets with labels so as not to be broken UX
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Fix on the failed Cypress test case in Widget_Popup_spec.js
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget
* feat: Controls for labels in widgets to align the widgets in forms and other places
-- Set the font size to 14px for NumericInputControl
Co-authored-by: ohansFavour <fohanekwu@gmail.com>
Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
labelText : string ;
labelPosition? : LabelPosition ;
labelAlignment? : Alignment ;
labelWidth? : number ;
2022-03-11 05:35:05 +00:00
isDirty? : boolean ;
2022-02-02 14:15:07 +00:00
}
export default MultiSelectWidget ;