-
Notifications
You must be signed in to change notification settings - Fork 3
feat(dropdown): Add toggle button and remove force open in editor option (WW-3773) #12
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
Open
leo91000
wants to merge
3
commits into
main
Choose a base branch
from
feature/WW-3773-add-toggle-button
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,55 +1,44 @@ | ||
| --- | ||
| name: ww-dropdown | ||
| description: The `ww-dropdown` component provides a customizable dropdown menu that can be triggered by click, hover, or right-click, with configurable positions, alignments, and optional animations, allowing for flexible integration into web applications. | ||
| keywords: | ||
| - triggertype | ||
| - position | ||
| - alignment | ||
| - offsetx | ||
| - offsety | ||
| - dropdownzindex | ||
| - disabled | ||
| - animated | ||
| - forcedisplayeditor | ||
| - closedropdown | ||
| - ww-layout | ||
| description: A customizable dropdown menu component with configurable trigger types, positions, and alignments. | ||
| keywords: [dropdown, menu, trigger, position, alignment, animation] | ||
| --- | ||
|
|
||
| #### ww-dropdown | ||
|
|
||
| Component Purpose: Renders a dropdown menu triggered by click, hover, or right-click with configurable positions and alignments. | ||
| ***Purpose:*** | ||
| Renders a dropdown menu that can be triggered by click, hover, or right-click, with configurable positions and alignments. The component supports animations and can be programmatically controlled. | ||
|
|
||
| Properties: | ||
| - triggerType: 'click' | 'hover' | 'right-click' - Trigger type for opening. Default: "click" | ||
| - position: 'top' | 'right' | 'bottom' | 'left' - Position relative to trigger. Default: "bottom" | ||
| - alignment: 'start' | 'center' | 'end' - Alignment along position axis. Default: "start" | ||
| - offsetX: string - Horizontal offset in px or %. Default: undefined | ||
| - offsetY: string - Vertical offset in px or %. Default: undefined | ||
| - dropdownZIndex: number - Z-index of dropdown (0-100). Default: undefined | ||
| - disabled: boolean - Disables dropdown. Default: undefined | ||
| - animated: boolean - Enables animations. Default: undefined | ||
| - forceDisplayEditor: boolean - Forces display in editor. Default: undefined | ||
| - triggerLayout: Array - Hidden property for trigger element layout. Default: [] | ||
| - dropdownLayout: Array - Hidden property for dropdown content layout. Default: [] | ||
| ***Properties:*** | ||
| - triggerType: 'click'|'hover'|'right-click' - Type of interaction that opens the dropdown. Default: "click" | ||
| - position: 'top'|'right'|'bottom'|'left' - Position of dropdown relative to trigger. Default: "bottom" | ||
| - alignment: 'start'|'center'|'end' - Alignment along position axis. Default: "start" | ||
| - offsetX: string - Horizontal offset in px or %. Example: "10px" or "50%" | ||
| - offsetY: string - Vertical offset in px or %. Example: "8px" or "20%" | ||
| - dropdownZIndex: number - Z-index of dropdown (0-100). Supports states and classes | ||
| - disabled: boolean - Disables the dropdown functionality | ||
| - animated: boolean - Enables animations for dropdown transitions | ||
| - forceDisplayEditor: boolean - Forces display in editor mode | ||
|
|
||
| Properties Details: | ||
| ***Slots:*** | ||
| - triggerLayout: (array of elements) - The element that triggers the dropdown. Example: ww-button | ||
| - dropdownLayout: (array of elements) - The content displayed in the dropdown. Example: ww-div with menu items | ||
|
|
||
| ***Element Actions:*** | ||
| - closeDropdown: (no args) Programmatically closes the dropdown | ||
|
|
||
| ***Notes:*** | ||
| - offsetX and offsetY support binding with string values (px or %) | ||
| - dropdownZIndex is responsive, supports states and classes, and can be bound to a number | ||
| - dropdownZIndex is responsive and supports states and classes | ||
| - alignment changes icon options based on position (horizontal/vertical alignment icons) | ||
| - disabled and animated properties can be bound to boolean values | ||
|
|
||
| Actions: | ||
| - closeDropdown: Programmatically closes the dropdown | ||
|
|
||
| Example: | ||
|
|
||
| {"uid":"dropdown-element","tag":"ww-dropdown","props":{"default":{"offsetY":"8px","position":"bottom","alignment":"start","triggerType":"click","forceDisplayEditor":true}},"children":{"triggerLayout":[{"uid":"dropdown-trigger-layout"}],"dropdownLayout":[{"uid":"dropdown-layout"}]}} | ||
| {"uid":"dropdown-trigger-layout","tag":"ww-button","props":{"default":{"disabled":false,"text":{"en":"<div>Click me</div>"}}},"styles":{"default":{"height":"38px","padding":"8px 16px","backgroundColor":"#000000","color":"#FFFFFF"}}} | ||
| {"uid":"dropdown-layout","tag":"ww-div","styles":{"default":{"width":"220px","padding":"8px","borderRadius":"12px"}},"children":{"children":[{"uid":"dropdown-layout-children"}]}} | ||
| {"uid":"dropdown-layout-children","tag":"ww-div","children":{"children":[{"uid":"layout-children-icon"},{"uid":"layout-children-text"}]}} | ||
| ***Example:*** | ||
| <elements> | ||
| {"uid":"dropdown-element","tag":"ww-dropdown","props":{"default":{"offsetY":"8px","position":"bottom","alignment":"start","triggerType":"click","forceDisplayEditor":true}},"slots":{"triggerLayout":[{"uid":"dropdown-trigger-layout"}],"dropdownLayout":[{"uid":"dropdown-layout"}]}} | ||
| {"uid":"dropdown-trigger-layout","tag":"ww-button","props":{"default":{"disabled":false,"text":{"en":"Click me"}}},"styles":{"default":{"height":"38px","padding":"8px 16px","backgroundColor":"#000000","color":"#FFFFFF"}}} | ||
| {"uid":"dropdown-layout","tag":"ww-div","styles":{"default":{"width":"220px","padding":"8px","borderRadius":"12px"}},"slots":{"children":[{"uid":"dropdown-layout-children"}]}} | ||
| {"uid":"dropdown-layout-children","tag":"ww-div","slots":{"children":[{"uid":"layout-children-icon"},{"uid":"layout-children-text"}]}} | ||
| {"uid":"layout-children-icon","tag":"ww-icon","props":{"default":{"icon":"icon-user","fontSize":"16","color":"black"}}} | ||
| {"uid":"layout-children-text","tag":"ww-text","props":{"default":{"text":{"en":"<div>Profile</div>"}}}} | ||
|
|
||
| Events: none | ||
|
|
||
| Variables: none | ||
| {"uid":"layout-children-text","tag":"ww-text","props":{"default":{"text":{"en":"Profile"}}}} | ||
| </elements> |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'toggleDropdown' property options incorrectly set the action to 'toggleForceOpenInEditor'; if the intended behavior is to toggle the dropdown state, update the action to 'toggleDropdown'.