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

Add PopupComponent #493

Merged
14 commits merged into from
Aug 25, 2021
Merged

Add PopupComponent #493

14 commits merged into from
Aug 25, 2021

Conversation

WestHuus
Copy link
Collaborator

@WestHuus WestHuus commented Jul 21, 2021

The PopupComponent should be used for to positioning content like tooltip or popover automatically in the right place near a trigger.

A popup mainly consists of a trigger (the Element(s)) which calls the content .
It can cen configured by

  • offset the space (in px) between trigger and content
  • flipping if no space on chosen available it will be find a right placement automatically
  • placement of the content around the trigger

The trigger provides two handler which can be used, the first is important to open/toggle the content the second close it.
content provides one handler which can be used to close it.

Example:

popup {
    offset(10.0)
    flipping(false)
    placement { topStart }
    trigger { toggle, close ->
        span {
            +"hover me"
            mouseenters.map { it.currentTarget } handledBy toggle
            mouseleaves.map { } handledBy close
        }
    }
    content { close ->
        div {
            +"my content"
            clicks.map{ } handledBy close
        }
    }
}

resolves #447

this PR needs #486 and #481 before it can be merged

@WestHuus WestHuus added the enhancement New feature or request label Jul 21, 2021
@WestHuus WestHuus added this to the 0.12 milestone Jul 21, 2021
@WestHuus WestHuus self-assigned this Jul 21, 2021
@WestHuus WestHuus requested a review from jamowei July 21, 2021 11:43
@WestHuus WestHuus changed the title Add PopperComponent Add PopupComponent Aug 19, 2021
@WestHuus WestHuus requested a review from a user August 19, 2021 04:51
@WestHuus WestHuus marked this pull request as ready for review August 23, 2021 04:53
@WestHuus WestHuus mentioned this pull request Aug 23, 2021
ghost
ghost previously approved these changes Aug 25, 2021
Christian Hausknecht added 2 commits August 25, 2021 10:39
- correct some minor documentation issues
- repairs and enhances example calls
- some minor formatting improvements
- revokes some irritating renaming of a DataTable's event (obviously was mistakenly applied)
@ghost ghost dismissed their stale review via 773d4fe August 25, 2021 12:44
@ghost ghost merged commit 10d2b57 into master Aug 25, 2021
@ghost ghost deleted the westhuus/popperComponent branch August 25, 2021 12:53
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Find better name for DropdownComponent
1 participant