Skip to content
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

feat: drag-resizing of dashboard items #7791

Merged
merged 12 commits into from
Sep 12, 2024

Conversation

tomivirkki
Copy link
Member

Description

Add support for drag resizing of <vaadin-dashboard> widgets

Kapture.2024-09-11.at.12.39.20.mp4

Added API:

  • Events:
    • dashboard-item-resize-start: Fired when item resizing starts
      • event.item: The item being resized
    • dashboard-item-resize-end: Fired when item resizing ends
      • event.item: The item being resized
    • dashboard-item-drag-resize: Fired when an item will be resized by dragging
      • event.item: The item being resized
      • colspan: The colspan to be assigned to the item
      • rowspan: The rowspan to be assigned to the item

Fixes https://github.com/orgs/vaadin/projects/70/views/1?pane=issue&itemId=74626094

Part of vaadin/platform#6626

Type of change

Feature

@ugur-vaadin
Copy link
Contributor

ugur-vaadin commented Sep 12, 2024

When the widget height gets lower, the resize handle can overlap the drag handle. Although I am not sure if this would create any problems with real widgets since it is unlikely that the widgets would get so short.
image

@tomivirkki
Copy link
Member Author

When the widget height gets lower, the resize handle can overlap the drag handle. Although I am not sure if this would create any problems with real widgets since it is unlikely that the widgets would get so short.

Note that there's no design yet for how the widgets are going to look like eventually (where the buttons are, Lumo/Material...) so I haven't invested much on perfecting the layout either. This PR is mainly about the resizing functionality.

I added a min-height to the content for now, but we'll need to discuss that also once the designs are available.

Copy link
Contributor

@ugur-vaadin ugur-vaadin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added one comment for a typo.

@tomivirkki tomivirkki merged commit b64f6b6 into feat/dashboard Sep 12, 2024
8 checks passed
@tomivirkki tomivirkki deleted the feat/dashboard-widget-drag-resize branch September 12, 2024 13:18
Copy link

sonarcloud bot commented Sep 12, 2024

}
}

cleanup() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could use hostConnected, hostDisconnected instead

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's a good tip. Pushed a refactor to use hostDisconnected to clean up the listener

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants