[New Component] Popover

Đang mở
#1,333 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
22/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp, javascript
Lĩnh vực
accessibility, frontend

Hướng nghiên cứu

Start with the existing Tooltip component and its JavaScript interop in wwwroot/blazor.bootstrap.js, since the issue says Popover should follow the same pattern. Create the new component under blazorbootstrap/Components/Popover/ and add its interop beside Tooltip's. Done means the must-have checklist works in the Server and WebAssembly demo hosts, with XML docs, a demo page and a docs page.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area-popover area-tooltip new component

Summary

Add a Popover component wrapping the Bootstrap 5 popover, with support for rich RenderFragment content and programmatic control.

Motivation

Users regularly ask for richer content than Tooltip supports — tables, formatted text, buttons, and small forms (#725, #1048). Popover is part of Bootstrap 5 and already available in the bundled script, so it follows the existing Tooltip interop pattern.

Proposed API (draft)

<Popover Title="Order details" Placement="PopoverPlacement.Right" Trigger="PopoverTrigger.Click">
    <ContentTemplate>
        <table class="table table-sm mb-0">...</table>
    </ContentTemplate>
    <ChildContent>
        <Button Color="ButtonColor.Primary">Show details</Button>
    </ChildContent>
</Popover>

@code {
    private Popover popover = default!;
    private Task ShowAsync() => popover.ShowAsync();
}

Must-have features (v1)

  • Title / Content (string) and TitleTemplate / ContentTemplate (RenderFragment).
  • Placement (PopoverPlacement: Auto, Top, Right, Bottom, Left).
  • Trigger (PopoverTrigger: Click, Hover, Focus, Manual; combinable).
  • Offset, Container, Color, Disabled.
  • Methods: ShowAsync, HideAsync, ToggleAsync, UpdateAsync (reposition).
  • Events: OnShowing, OnShown, OnHiding, OnHidden.
  • Dismiss on outside click and Escape (configurable AutoClose).
  • Content re-renders in place without destroying and re-creating the popover.
  • Interop instance disposed on component dispose and safe on circuit disconnect.

Accessibility

  • Trigger element gets aria-describedby / aria-expanded.
  • Focus moves into interactive popover content when opened by keyboard and returns to the trigger on close.

Out of scope (later)

  • Using Popover inside Grid filter menus and Dropdowns.
  • Auto width-to-content sizing options.

Acceptance criteria

  • Component in blazorbootstrap/Components/Popover/ with interop in wwwroot/blazor.bootstrap.js.
  • XML docs on all public parameters, methods, and events.
  • Demo page covering: placements, triggers, HTML/table content, programmatic control, events, dismiss behavior, colors, disabled.
  • Verified in Server and WebAssembly demo hosts, including navigation away while a popover is open.
  • Docs page docs/docs/05-components/popover.mdx.
  • Builds for .NET 8, 9, 10.

Related

#725, #1048

Ngôn ngữ chính
HTML
Star
1.2k
Fork
111
Merge trung bình
4 phút
Pull request đã merge (30 ngày)
55

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của vikramlearning/blazorbootstrap

Tất cả issue của vikramlearning/blazorbootstrap

Issue tương tự

Thêm issue về Accessibility

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.