"""HTML element ID generators for virtual collection components."""

# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/core/html_ids.ipynb.

# %% auto #0
__all__ = ['VirtualCollectionHtmlIds']

# %% ../../nbs/core/html_ids.ipynb #9b8b9ac9
from dataclasses import dataclass

# %% ../../nbs/core/html_ids.ipynb #3d0f88b9
@dataclass
class VirtualCollectionHtmlIds:
    """HTML element ID generators for a virtual collection instance."""
    prefix: str  # Instance prefix (e.g., 'vc0', 'fb')

    # -- Outer container --
    @property
    def collection(self) -> str: return f"{self.prefix}-collection"

    # -- Wrapper (viewport-fit target) --
    @property
    def wrapper(self) -> str: return f"{self.prefix}-wrapper"

    # -- Table container --
    @property
    def table(self) -> str: return f"{self.prefix}-table"

    # -- Header --
    @property
    def header(self) -> str: return f"{self.prefix}-header"

    # -- Viewport (kept for viewport-fit compatibility) --
    @property
    def viewport(self) -> str: return f"{self.prefix}-viewport"

    # -- Rows container (table-row-group) --
    @property
    def rows(self) -> str: return f"{self.prefix}-rows"

    # -- Slot IDs (position-based, display:contents wrappers) --
    def slot_id(self, slot_index: int) -> str:  # ID for a viewport slot
        return f"{self.prefix}-slot-{slot_index}"

    # -- Dynamic row/cell/item IDs (data-based, on inner content) --
    def row_id(self, index: int) -> str:  # ID for a table row
        return f"{self.prefix}-row-{index}"

    def cell_id(self, row_index: int, col_key: str) -> str:  # ID for a table cell
        return f"{self.prefix}-row-{row_index}-col-{col_key}"

    def item_id(self, index: int) -> str:  # ID for a grid item
        return f"{self.prefix}-item-{index}"

    # -- Custom scrollbar --
    @property
    def scrollbar_track(self) -> str: return f"{self.prefix}-scrollbar-track"

    @property
    def scrollbar_thumb(self) -> str: return f"{self.prefix}-scrollbar-thumb"

    # -- Footer --
    @property
    def footer(self) -> str: return f"{self.prefix}-footer"

    # -- Progress indicator --
    @property
    def progress(self) -> str: return f"{self.prefix}-progress"

    # -- Hidden inputs --
    @property
    def window_start_input(self) -> str: return f"{self.prefix}-window-start-input"

    # -- Refit trigger (OOB target for auto-fit re-evaluation after item mutations) --
    @property
    def refit_trigger(self) -> str: return f"{self.prefix}-refit-trigger"
