Class: Primer::OpenProject::FilterableTreeView::SubTree

Inherits:
Alpha::TreeView::SubTree show all
Defined in:
app/components/primer/open_project/filterable_tree_view/sub_tree.rb

Overview

A ‘FilterableTreeView` sub-tree node.

This component is part of the <%= link_to_component(Primer::OpenProject::FilterableTreeView) %> component and should not be used directly.

Constant Summary

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 Attribute Summary

Attributes inherited from Alpha::TreeView::SubTree

#node_variant

Instance Method Summary collapse

Methods inherited from Alpha::TreeView::SubTree

#defer?, #initialize

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

This class inherits a constructor from Primer::Alpha::TreeView::SubTree

Instance Method Details

#with_leaf(**system_arguments, &block) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'app/components/primer/open_project/filterable_tree_view/sub_tree.rb', line 26

def with_leaf(**system_arguments, &block)
  system_arguments[:select_variant] ||= :multiple

  if system_arguments[:select_variant] != :multiple && system_arguments[:select_variant] != :single
    raise ArgumentError, "FilterableTreeView only supports `:multiple` or `:single` as select_variant"
  end

  super(
    **system_arguments,
    &block
  )
end

#with_loading_skeleton(**system_arguments) ⇒ Object

Raises:

  • (ArgumentError)


43
44
45
# File 'app/components/primer/open_project/filterable_tree_view/sub_tree.rb', line 43

def with_loading_skeleton(**system_arguments)
  raise ArgumentError, "FilterableTreeView does not support asynchronous loading"
end

#with_loading_spinner(**system_arguments) ⇒ Object

Raises:

  • (ArgumentError)


39
40
41
# File 'app/components/primer/open_project/filterable_tree_view/sub_tree.rb', line 39

def with_loading_spinner(**system_arguments)
  raise ArgumentError, "FilterableTreeView does not support asynchronous loading"
end

#with_sub_tree(**system_arguments, &block) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/components/primer/open_project/filterable_tree_view/sub_tree.rb', line 11

def with_sub_tree(**system_arguments, &block)
  system_arguments[:select_variant] ||= :multiple

  if system_arguments[:select_variant] != :multiple && system_arguments[:select_variant] != :single
    raise ArgumentError, "FilterableTreeView only supports `:multiple` or `:single` as select_variant"
  end

  super(
    sub_tree_component_klass: self.class,
    **system_arguments,
    select_strategy: :self,
    &block
  )
end