Class: Primer::OpenProject::SubHeader

Inherits:
Component
  • Object
show all
Defined in:
app/components/primer/open_project/sub_header.rb

Overview

The SubHeader contains specific actions to modify the page content below, e.g a filter button or a create button It should not be used stand alone, but in combination with a PageHeader, either as a direct sibling or as part of a tab content

Constant Summary collapse

HIDDEN_FILTER_TARGET_SELECTOR =
"sub-header.hiddenItemsOnExpandedFilter"
SHOWN_FILTER_TARGET_SELECTOR =
"sub-header.shownItemsOnExpandedFilter"

Constants inherited from Component

Component::INVALID_ARIA_LABEL_TAGS

Constants included from Status::Dsl

Status::Dsl::STATUSES

Constants included from ViewHelper

ViewHelper::HELPERS

Constants included from TestSelectorHelper

TestSelectorHelper::TEST_SELECTOR_TAG

Constants included from FetchOrFallbackHelper

FetchOrFallbackHelper::InvalidValueError

Constants included from AttributesHelper

AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES

Instance Method Summary collapse

Methods inherited from Component

deprecated?, generate_id

Methods included from JoinStyleArgumentsHelper

#join_style_arguments

Methods included from TestSelectorHelper

#add_test_selector

Methods included from FetchOrFallbackHelper

#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?

Methods included from ClassNameHelper

#class_names

Methods included from AttributesHelper

#aria, #data, #extract_data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes

Methods included from ExperimentalSlotHelpers

included

Methods included from ExperimentalRenderHelpers

included

Constructor Details

#initialize(**system_arguments) ⇒ SubHeader

Returns a new instance of SubHeader.

Parameters:

  • system_arguments (Hash)

    <%= link_to_system_arguments_docs %>



135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'app/components/primer/open_project/sub_header.rb', line 135

def initialize(**system_arguments)
  @system_arguments = system_arguments
  @system_arguments[:tag] = :"sub-header"

  @filter_container = Primer::BaseComponent.new(tag: :div,
                                                classes: "SubHeader-filterContainer",
                                                display: [:none, :flex],
                                                data: { targets: SHOWN_FILTER_TARGET_SELECTOR })

  @system_arguments[:classes] = class_names(
    "SubHeader",
    system_arguments[:classes]
  )
end