-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore: add wds multiselect #39307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
chore: add wds multiselect #39307
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
4f121b4
add multiselect
jsartisan bdd6b4e
style changes
jsartisan bd5478b
add multiselect widget
jsartisan 2312916
add multiselect widget
jsartisan 215b9ea
update comments and types
jsartisan 264b253
fix validation rules
jsartisan c9e8efc
revert is loading change
jsartisan 0d73bb7
Removed a modified file from pull request
jsartisan 9afcd06
remove uncessary code
jsartisan 2d88a49
revert onChange event
jsartisan 796d186
remove uncessary code
jsartisan 738d188
minor update
jsartisan 8ab37a6
fix input height
jsartisan 6fbb037
fix input height
jsartisan 92e0c3e
change order of css
jsartisan cd6863b
remove multiselect
jsartisan 8336491
try removing derived property
jsartisan a5568e3
add derived properties again and try
jsartisan 3d8cbf4
remove unecessary code
jsartisan 5f48998
add old derived properties
jsartisan 4ad1422
add old derived properties
jsartisan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
app/client/src/modules/ui-builder/ui/wds/WDSMultiSelectWidget/config/anvilConfig.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import type { AnvilConfig } from "WidgetProvider/constants"; | ||
|
|
||
| export const anvilConfig: AnvilConfig = { | ||
| isLargeWidget: false, | ||
| widgetSize: { | ||
| minWidth: { | ||
| base: "100%", | ||
| "180px": "sizing-30", | ||
| }, | ||
| }, | ||
| }; |
22 changes: 22 additions & 0 deletions
22
app/client/src/modules/ui-builder/ui/wds/WDSMultiSelectWidget/config/autocompleteConfig.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { DefaultAutocompleteDefinitions } from "widgets/WidgetUtils"; | ||
|
|
||
| export const autocompleteConfig = { | ||
| "!doc": | ||
| "MultiSelect is used to capture user input/s from a specified list of permitted inputs. A MultiSelect can capture multiple choices", | ||
| "!url": "https://docs.appsmith.com/widget-reference/dropdown", | ||
| isVisible: DefaultAutocompleteDefinitions.isVisible, | ||
| selectedOptionValues: { | ||
| "!type": "string", | ||
| "!doc": "The values selected in a multi select dropdown", | ||
| "!url": "https://docs.appsmith.com/widget-reference/dropdown", | ||
| }, | ||
| selectedOptionLabels: { | ||
| "!type": "string", | ||
| "!doc": "The selected options's labels in a multi select dropdown", | ||
| "!url": "https://docs.appsmith.com/widget-reference/dropdown", | ||
| }, | ||
| isDisabled: "bool", | ||
| isValid: "bool", | ||
| isDirty: "bool", | ||
| options: "[$__dropdownOption__$]", | ||
| }; |
21 changes: 21 additions & 0 deletions
21
app/client/src/modules/ui-builder/ui/wds/WDSMultiSelectWidget/config/defaultsConfig.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { ResponsiveBehavior } from "layoutSystems/common/utils/constants"; | ||
| import type { WidgetDefaultProps } from "WidgetProvider/constants"; | ||
| import { SAMPLE_DATA } from "../widget/constants"; | ||
|
|
||
| export const defaultsConfig = { | ||
| animateLoading: true, | ||
| label: "Label", | ||
| sourceData: JSON.stringify(SAMPLE_DATA, null, 2), | ||
| optionLabel: "name", | ||
| optionValue: "code", | ||
| defaultOptionValues: "", | ||
| isRequired: false, | ||
| isDisabled: false, | ||
| isVisible: true, | ||
| isInline: false, | ||
| widgetName: "MultiSelect", | ||
| version: 1, | ||
| responsiveBehavior: ResponsiveBehavior.Fill, | ||
| dynamicPropertyPathList: [{ key: "sourceData" }], | ||
| placeholderText: "Select an item", | ||
| } as unknown as WidgetDefaultProps; | ||
7 changes: 7 additions & 0 deletions
7
app/client/src/modules/ui-builder/ui/wds/WDSMultiSelectWidget/config/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export * from "./propertyPaneConfig"; | ||
| export { metaConfig } from "./metaConfig"; | ||
| export { anvilConfig } from "./anvilConfig"; | ||
| export { defaultsConfig } from "./defaultsConfig"; | ||
| export { settersConfig } from "./settersConfig"; | ||
| export { methodsConfig } from "./methodsConfig"; | ||
| export { autocompleteConfig } from "./autocompleteConfig"; |
8 changes: 8 additions & 0 deletions
8
app/client/src/modules/ui-builder/ui/wds/WDSMultiSelectWidget/config/metaConfig.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { WIDGET_TAGS } from "constants/WidgetConstants"; | ||
|
|
||
| export const metaConfig = { | ||
| name: "MultiSelect", | ||
| tags: [WIDGET_TAGS.SELECT], | ||
| needsMeta: true, | ||
| searchTags: ["choice", "option", "choose", "pick", "select", "dropdown"], | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ichik Could you please verify this?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KelvinOm LGTM |
||
| }; | ||
65 changes: 65 additions & 0 deletions
65
app/client/src/modules/ui-builder/ui/wds/WDSMultiSelectWidget/config/methodsConfig.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| import type { | ||
| PropertyUpdates, | ||
| SnipingModeProperty, | ||
| } from "WidgetProvider/constants"; | ||
| import type { | ||
| WidgetQueryConfig, | ||
| WidgetQueryGenerationFormConfig, | ||
| } from "WidgetQueryGenerators/types"; | ||
| import { RadioGroupIcon, SelectThumbnail } from "appsmith-icons"; | ||
| import type { DynamicPath } from "utils/DynamicBindingUtils"; | ||
| import type { WidgetProps } from "widgets/BaseWidget"; | ||
|
|
||
| export const methodsConfig = { | ||
| getSnipingModeUpdates: ( | ||
| propValueMap: SnipingModeProperty, | ||
| ): PropertyUpdates[] => { | ||
| return [ | ||
| { | ||
| propertyPath: "sourceData", | ||
| propertyValue: propValueMap.data, | ||
| isDynamicPropertyPath: true, | ||
| }, | ||
| ]; | ||
| }, | ||
| getQueryGenerationConfig(widget: WidgetProps) { | ||
| return { | ||
| select: { | ||
| where: `${widget.widgetName}.filterText`, | ||
| }, | ||
| }; | ||
| }, | ||
| getPropertyUpdatesForQueryBinding( | ||
| queryConfig: WidgetQueryConfig, | ||
| widget: WidgetProps, | ||
| formConfig: WidgetQueryGenerationFormConfig, | ||
| ) { | ||
| let modify; | ||
|
|
||
| const dynamicPropertyPathList: DynamicPath[] = [ | ||
| ...(widget.dynamicPropertyPathList || []), | ||
| ]; | ||
|
|
||
| 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, | ||
| defaultOptionValues: "", | ||
| serverSideFiltering: false, | ||
| onFilterUpdate: queryConfig.select.run, | ||
| }; | ||
|
|
||
| dynamicPropertyPathList.push({ key: "sourceData" }); | ||
| } | ||
|
|
||
| return { | ||
| modify, | ||
| dynamicUpdates: { | ||
| dynamicPropertyPathList, | ||
| }, | ||
| }; | ||
| }, | ||
| IconCmp: RadioGroupIcon, | ||
| ThumbnailCmp: SelectThumbnail, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.