openproject-primer_view_components 0.64.0 → 0.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/app/assets/javascripts/components/primer/open_project/collapsible.d.ts +2 -0
- data/app/assets/javascripts/components/primer/open_project/tree_view/tree_view.d.ts +29 -0
- data/app/assets/javascripts/components/primer/open_project/tree_view/tree_view_icon_pair_element.d.ts +15 -0
- data/app/assets/javascripts/components/primer/open_project/tree_view/tree_view_include_fragment_element.d.ts +9 -0
- data/app/assets/javascripts/components/primer/open_project/tree_view/tree_view_roving_tab_index.d.ts +3 -0
- data/app/assets/javascripts/components/primer/open_project/tree_view/tree_view_sub_tree_node_element.d.ts +38 -0
- data/app/assets/javascripts/components/primer/primer.d.ts +4 -0
- data/app/assets/javascripts/components/primer/shared_events.d.ts +15 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/select_panel.css +1 -1
- data/app/components/primer/alpha/select_panel.css.json +2 -2
- data/app/components/primer/alpha/select_panel.css.map +1 -1
- data/app/components/primer/alpha/select_panel.html.erb +1 -1
- data/app/components/primer/alpha/select_panel.pcss +5 -2
- data/app/components/primer/beta/spinner.html.erb +1 -1
- data/app/components/primer/beta/spinner.rb +2 -0
- data/app/components/primer/open_project/border_box/collapsible_header.css +1 -1
- data/app/components/primer/open_project/border_box/collapsible_header.css.json +2 -1
- data/app/components/primer/open_project/border_box/collapsible_header.css.map +1 -1
- data/app/components/primer/open_project/border_box/collapsible_header.html.erb +12 -1
- data/app/components/primer/open_project/border_box/collapsible_header.pcss +4 -0
- data/app/components/primer/open_project/border_box/collapsible_header.rb +16 -12
- data/app/components/primer/open_project/collapsible.d.ts +2 -0
- data/app/components/primer/open_project/collapsible.js +11 -0
- data/app/components/primer/open_project/collapsible.ts +10 -0
- data/app/components/primer/open_project/collapsible_section.html.erb +14 -2
- data/app/components/primer/open_project/collapsible_section.rb +5 -1
- data/app/components/primer/open_project/danger_dialog.html.erb +4 -0
- data/app/components/primer/open_project/feedback_dialog.html.erb +5 -0
- data/app/components/primer/open_project/file_tree_view/directory_node.html.erb +5 -0
- data/app/components/primer/open_project/file_tree_view/directory_node.rb +24 -0
- data/app/components/primer/open_project/file_tree_view/file_node.html.erb +2 -0
- data/app/components/primer/open_project/file_tree_view/file_node.rb +14 -0
- data/app/components/primer/open_project/file_tree_view.rb +15 -0
- data/app/components/primer/open_project/skeleton_box.css +1 -0
- data/app/components/primer/open_project/skeleton_box.css.json +6 -0
- data/app/components/primer/open_project/skeleton_box.css.map +1 -0
- data/app/components/primer/open_project/skeleton_box.html.erb +1 -0
- data/app/components/primer/open_project/skeleton_box.pcss +30 -0
- data/app/components/primer/open_project/skeleton_box.rb +27 -0
- data/app/components/primer/open_project/tree_view/icon.html.erb +1 -0
- data/app/components/primer/open_project/tree_view/icon.rb +22 -0
- data/app/components/primer/open_project/tree_view/icon_pair.html.erb +13 -0
- data/app/components/primer/open_project/tree_view/icon_pair.rb +42 -0
- data/app/components/primer/open_project/tree_view/leading_action.html.erb +3 -0
- data/app/components/primer/open_project/tree_view/leading_action.rb +18 -0
- data/app/components/primer/open_project/tree_view/leaf_node.html.erb +18 -0
- data/app/components/primer/open_project/tree_view/leaf_node.rb +96 -0
- data/app/components/primer/open_project/tree_view/loading_failure_message.html.erb +13 -0
- data/app/components/primer/open_project/tree_view/loading_failure_message.rb +31 -0
- data/app/components/primer/open_project/tree_view/node.html.erb +32 -0
- data/app/components/primer/open_project/tree_view/node.rb +155 -0
- data/app/components/primer/open_project/tree_view/skeleton_loader.html.erb +23 -0
- data/app/components/primer/open_project/tree_view/skeleton_loader.rb +36 -0
- data/app/components/primer/open_project/tree_view/spinner_loader.html.erb +20 -0
- data/app/components/primer/open_project/tree_view/spinner_loader.rb +33 -0
- data/app/components/primer/open_project/tree_view/sub_tree.html.erb +21 -0
- data/app/components/primer/open_project/tree_view/sub_tree.rb +106 -0
- data/app/components/primer/open_project/tree_view/sub_tree_container.html.erb +3 -0
- data/app/components/primer/open_project/tree_view/sub_tree_container.rb +39 -0
- data/app/components/primer/open_project/tree_view/sub_tree_node.html.erb +49 -0
- data/app/components/primer/open_project/tree_view/sub_tree_node.rb +172 -0
- data/app/components/primer/open_project/tree_view/tree_view.d.ts +29 -0
- data/app/components/primer/open_project/tree_view/tree_view.js +238 -0
- data/app/components/primer/open_project/tree_view/tree_view.ts +257 -0
- data/app/components/primer/open_project/tree_view/tree_view_icon_pair_element.d.ts +15 -0
- data/app/components/primer/open_project/tree_view/tree_view_icon_pair_element.js +62 -0
- data/app/components/primer/open_project/tree_view/tree_view_icon_pair_element.ts +56 -0
- data/app/components/primer/open_project/tree_view/tree_view_include_fragment_element.d.ts +9 -0
- data/app/components/primer/open_project/tree_view/tree_view_include_fragment_element.js +29 -0
- data/app/components/primer/open_project/tree_view/tree_view_include_fragment_element.ts +29 -0
- data/app/components/primer/open_project/tree_view/tree_view_roving_tab_index.d.ts +3 -0
- data/app/components/primer/open_project/tree_view/tree_view_roving_tab_index.js +126 -0
- data/app/components/primer/open_project/tree_view/tree_view_roving_tab_index.ts +156 -0
- data/app/components/primer/open_project/tree_view/tree_view_sub_tree_node_element.d.ts +38 -0
- data/app/components/primer/open_project/tree_view/tree_view_sub_tree_node_element.js +362 -0
- data/app/components/primer/open_project/tree_view/tree_view_sub_tree_node_element.ts +402 -0
- data/app/components/primer/open_project/tree_view/visual.html.erb +14 -0
- data/app/components/primer/open_project/tree_view/visual.rb +27 -0
- data/app/components/primer/open_project/tree_view.css +1 -0
- data/app/components/primer/open_project/tree_view.css.json +42 -0
- data/app/components/primer/open_project/tree_view.css.map +1 -0
- data/app/components/primer/open_project/tree_view.html.erb +7 -0
- data/app/components/primer/open_project/tree_view.pcss +319 -0
- data/app/components/primer/open_project/tree_view.rb +367 -0
- data/app/components/primer/primer.d.ts +4 -0
- data/app/components/primer/primer.js +4 -0
- data/app/components/primer/primer.pcss +2 -0
- data/app/components/primer/primer.ts +4 -0
- data/app/components/primer/shared_events.d.ts +15 -0
- data/app/components/primer/shared_events.ts +19 -0
- data/app/lib/primer/forms/acts_as_component.rb +1 -12
- data/lib/primer/view_components/version.rb +1 -1
- data/previews/primer/open_project/file_tree_view_preview/default.html.erb +16 -0
- data/previews/primer/open_project/file_tree_view_preview/playground.html.erb +4 -0
- data/previews/primer/open_project/file_tree_view_preview.rb +69 -0
- data/previews/primer/open_project/skeleton_box_preview.rb +20 -0
- data/previews/primer/open_project/tree_view_preview/default.html.erb +24 -0
- data/previews/primer/open_project/tree_view_preview/empty.html.erb +10 -0
- data/previews/primer/open_project/tree_view_preview/leaf_node_playground.html.erb +15 -0
- data/previews/primer/open_project/tree_view_preview/loading_failure.html.erb +36 -0
- data/previews/primer/open_project/tree_view_preview/loading_skeleton.html.erb +12 -0
- data/previews/primer/open_project/tree_view_preview/loading_spinner.html.erb +12 -0
- data/previews/primer/open_project/tree_view_preview/playground.html.erb +4 -0
- data/previews/primer/open_project/tree_view_preview.rb +139 -0
- data/static/arguments.json +400 -0
- data/static/audited_at.json +17 -0
- data/static/classes.json +18 -0
- data/static/constants.json +83 -0
- data/static/info_arch.json +1379 -0
- data/static/previews.json +167 -0
- data/static/statuses.json +17 -0
- metadata +75 -2
data/static/info_arch.json
CHANGED
@@ -17690,6 +17690,12 @@
|
|
17690
17690
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/border_box/collapsible_header.rb",
|
17691
17691
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/border_box/collapsible_header/default/",
|
17692
17692
|
"parameters": [
|
17693
|
+
{
|
17694
|
+
"name": "id",
|
17695
|
+
"type": "String",
|
17696
|
+
"default": "`self.class.generate_id`",
|
17697
|
+
"description": "The unique ID of the collapsible header."
|
17698
|
+
},
|
17693
17699
|
{
|
17694
17700
|
"name": "collapsed",
|
17695
17701
|
"type": "Boolean",
|
@@ -17952,6 +17958,12 @@
|
|
17952
17958
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/collapsible_section.rb",
|
17953
17959
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/collapsible_section/default/",
|
17954
17960
|
"parameters": [
|
17961
|
+
{
|
17962
|
+
"name": "id",
|
17963
|
+
"type": "String",
|
17964
|
+
"default": "`self.class.generate_id`",
|
17965
|
+
"description": "The unique ID of the collapsible section."
|
17966
|
+
},
|
17955
17967
|
{
|
17956
17968
|
"name": "collapsed",
|
17957
17969
|
"type": "Boolean",
|
@@ -18735,6 +18747,169 @@
|
|
18735
18747
|
|
18736
18748
|
]
|
18737
18749
|
},
|
18750
|
+
{
|
18751
|
+
"fully_qualified_name": "Primer::OpenProject::FileTreeView",
|
18752
|
+
"description": "",
|
18753
|
+
"accessibility_docs": null,
|
18754
|
+
"is_form_component": false,
|
18755
|
+
"is_published": true,
|
18756
|
+
"requires_js": false,
|
18757
|
+
"component": "OpenProject::FileTreeView",
|
18758
|
+
"status": "alpha",
|
18759
|
+
"a11y_reviewed": false,
|
18760
|
+
"short_name": "OpenProjectFileTreeView",
|
18761
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/file_tree_view.rb",
|
18762
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/file_tree_view/default/",
|
18763
|
+
"parameters": [
|
18764
|
+
{
|
18765
|
+
"name": "system_arguments",
|
18766
|
+
"type": "Hash",
|
18767
|
+
"default": "N/A",
|
18768
|
+
"description": "{{link_to_system_arguments_docs}}."
|
18769
|
+
}
|
18770
|
+
],
|
18771
|
+
"slots": [
|
18772
|
+
{
|
18773
|
+
"name": "nodes",
|
18774
|
+
"description": null,
|
18775
|
+
"parameters": [
|
18776
|
+
|
18777
|
+
]
|
18778
|
+
}
|
18779
|
+
],
|
18780
|
+
"methods": [
|
18781
|
+
|
18782
|
+
],
|
18783
|
+
"previews": [
|
18784
|
+
{
|
18785
|
+
"preview_path": "primer/open_project/file_tree_view/default",
|
18786
|
+
"name": "default",
|
18787
|
+
"snapshot": "interactive",
|
18788
|
+
"skip_rules": {
|
18789
|
+
"wont_fix": [
|
18790
|
+
"region"
|
18791
|
+
],
|
18792
|
+
"will_fix": [
|
18793
|
+
"color-contrast"
|
18794
|
+
]
|
18795
|
+
}
|
18796
|
+
},
|
18797
|
+
{
|
18798
|
+
"preview_path": "primer/open_project/file_tree_view/playground",
|
18799
|
+
"name": "playground",
|
18800
|
+
"snapshot": "false",
|
18801
|
+
"skip_rules": {
|
18802
|
+
"wont_fix": [
|
18803
|
+
"region"
|
18804
|
+
],
|
18805
|
+
"will_fix": [
|
18806
|
+
"color-contrast"
|
18807
|
+
]
|
18808
|
+
}
|
18809
|
+
}
|
18810
|
+
],
|
18811
|
+
"subcomponents": [
|
18812
|
+
|
18813
|
+
]
|
18814
|
+
},
|
18815
|
+
{
|
18816
|
+
"fully_qualified_name": "Primer::OpenProject::FileTreeView::DirectoryNode",
|
18817
|
+
"description": "",
|
18818
|
+
"accessibility_docs": null,
|
18819
|
+
"is_form_component": false,
|
18820
|
+
"is_published": true,
|
18821
|
+
"requires_js": false,
|
18822
|
+
"component": "OpenProject::FileTreeView::DirectoryNode",
|
18823
|
+
"status": "alpha",
|
18824
|
+
"a11y_reviewed": false,
|
18825
|
+
"short_name": "OpenProjectFileTreeViewDirectoryNode",
|
18826
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/file_tree_view/directory_node.rb",
|
18827
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/file_tree_view/directory_node/default/",
|
18828
|
+
"parameters": [
|
18829
|
+
|
18830
|
+
],
|
18831
|
+
"slots": [
|
18832
|
+
{
|
18833
|
+
"name": "leading_visual",
|
18834
|
+
"description": null,
|
18835
|
+
"parameters": [
|
18836
|
+
|
18837
|
+
]
|
18838
|
+
},
|
18839
|
+
{
|
18840
|
+
"name": "leading_action",
|
18841
|
+
"description": null,
|
18842
|
+
"parameters": [
|
18843
|
+
|
18844
|
+
]
|
18845
|
+
},
|
18846
|
+
{
|
18847
|
+
"name": "trailing_visual",
|
18848
|
+
"description": null,
|
18849
|
+
"parameters": [
|
18850
|
+
|
18851
|
+
]
|
18852
|
+
}
|
18853
|
+
],
|
18854
|
+
"methods": [
|
18855
|
+
|
18856
|
+
],
|
18857
|
+
"previews": [
|
18858
|
+
|
18859
|
+
],
|
18860
|
+
"subcomponents": [
|
18861
|
+
|
18862
|
+
]
|
18863
|
+
},
|
18864
|
+
{
|
18865
|
+
"fully_qualified_name": "Primer::OpenProject::FileTreeView::FileNode",
|
18866
|
+
"description": "",
|
18867
|
+
"accessibility_docs": null,
|
18868
|
+
"is_form_component": false,
|
18869
|
+
"is_published": true,
|
18870
|
+
"requires_js": false,
|
18871
|
+
"component": "OpenProject::FileTreeView::FileNode",
|
18872
|
+
"status": "alpha",
|
18873
|
+
"a11y_reviewed": false,
|
18874
|
+
"short_name": "OpenProjectFileTreeViewFileNode",
|
18875
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/file_tree_view/file_node.rb",
|
18876
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/file_tree_view/file_node/default/",
|
18877
|
+
"parameters": [
|
18878
|
+
|
18879
|
+
],
|
18880
|
+
"slots": [
|
18881
|
+
{
|
18882
|
+
"name": "leading_visual",
|
18883
|
+
"description": null,
|
18884
|
+
"parameters": [
|
18885
|
+
|
18886
|
+
]
|
18887
|
+
},
|
18888
|
+
{
|
18889
|
+
"name": "leading_action",
|
18890
|
+
"description": null,
|
18891
|
+
"parameters": [
|
18892
|
+
|
18893
|
+
]
|
18894
|
+
},
|
18895
|
+
{
|
18896
|
+
"name": "trailing_visual",
|
18897
|
+
"description": null,
|
18898
|
+
"parameters": [
|
18899
|
+
|
18900
|
+
]
|
18901
|
+
}
|
18902
|
+
],
|
18903
|
+
"methods": [
|
18904
|
+
|
18905
|
+
],
|
18906
|
+
"previews": [
|
18907
|
+
|
18908
|
+
],
|
18909
|
+
"subcomponents": [
|
18910
|
+
|
18911
|
+
]
|
18912
|
+
},
|
18738
18913
|
{
|
18739
18914
|
"fully_qualified_name": "Primer::OpenProject::FlexLayout",
|
18740
18915
|
"description": "A layouting component used to arrange multiple components next / below each other",
|
@@ -19782,6 +19957,77 @@
|
|
19782
19957
|
|
19783
19958
|
]
|
19784
19959
|
},
|
19960
|
+
{
|
19961
|
+
"fully_qualified_name": "Primer::OpenProject::SkeletonBox",
|
19962
|
+
"description": "A SkeletonBox provides a placeholder for non-text, non-Avatar elements (e.g., hero images)\nthat are still loading. You can adjust width and height to match the content's dimensions.",
|
19963
|
+
"accessibility_docs": null,
|
19964
|
+
"is_form_component": false,
|
19965
|
+
"is_published": true,
|
19966
|
+
"requires_js": false,
|
19967
|
+
"component": "OpenProject::SkeletonBox",
|
19968
|
+
"status": "alpha",
|
19969
|
+
"a11y_reviewed": false,
|
19970
|
+
"short_name": "OpenProjectSkeletonBox",
|
19971
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/skeleton_box.rb",
|
19972
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/skeleton_box/default/",
|
19973
|
+
"parameters": [
|
19974
|
+
{
|
19975
|
+
"name": "height",
|
19976
|
+
"type": "String",
|
19977
|
+
"default": "`nil`",
|
19978
|
+
"description": "Any valid CSS height."
|
19979
|
+
},
|
19980
|
+
{
|
19981
|
+
"name": "width",
|
19982
|
+
"type": "String",
|
19983
|
+
"default": "`nil`",
|
19984
|
+
"description": "Any valid CSS width."
|
19985
|
+
},
|
19986
|
+
{
|
19987
|
+
"name": "system_arguments",
|
19988
|
+
"type": "Hash",
|
19989
|
+
"default": "N/A",
|
19990
|
+
"description": "{{link_to_system_arguments_docs}}"
|
19991
|
+
}
|
19992
|
+
],
|
19993
|
+
"slots": [
|
19994
|
+
|
19995
|
+
],
|
19996
|
+
"methods": [
|
19997
|
+
|
19998
|
+
],
|
19999
|
+
"previews": [
|
20000
|
+
{
|
20001
|
+
"preview_path": "primer/open_project/skeleton_box/default",
|
20002
|
+
"name": "default",
|
20003
|
+
"snapshot": "false",
|
20004
|
+
"skip_rules": {
|
20005
|
+
"wont_fix": [
|
20006
|
+
"region"
|
20007
|
+
],
|
20008
|
+
"will_fix": [
|
20009
|
+
"color-contrast"
|
20010
|
+
]
|
20011
|
+
}
|
20012
|
+
},
|
20013
|
+
{
|
20014
|
+
"preview_path": "primer/open_project/skeleton_box/playground",
|
20015
|
+
"name": "playground",
|
20016
|
+
"snapshot": "false",
|
20017
|
+
"skip_rules": {
|
20018
|
+
"wont_fix": [
|
20019
|
+
"region"
|
20020
|
+
],
|
20021
|
+
"will_fix": [
|
20022
|
+
"color-contrast"
|
20023
|
+
]
|
20024
|
+
}
|
20025
|
+
}
|
20026
|
+
],
|
20027
|
+
"subcomponents": [
|
20028
|
+
|
20029
|
+
]
|
20030
|
+
},
|
19785
20031
|
{
|
19786
20032
|
"fully_qualified_name": "Primer::OpenProject::SubHeader",
|
19787
20033
|
"description": "The SubHeader contains specific actions to modify the page content below, e.g a filter button or a create button\nIt should not be used stand alone, but in combination with a PageHeader, either as a direct sibling or as part of a tab content",
|
@@ -19953,6 +20199,1139 @@
|
|
19953
20199
|
|
19954
20200
|
]
|
19955
20201
|
},
|
20202
|
+
{
|
20203
|
+
"fully_qualified_name": "Primer::OpenProject::TreeView",
|
20204
|
+
"description": "TreeView is a hierarchical list of items that may have a parent-child relationship where children\ncan be toggled into view by expanding or collapsing their parent item.\n\n## Terminology\n\nConsider the following tree structure:\n\nsrc\n├ button.rb\n└ action_list\n ├ item.rb\n └ header.rb\n\n1. **Node**. A node is an item in the tree. Nodes can either be \"leaf\" nodes (i.e. have no children), or \"sub-tree\"\nnodes, which do have children. In the example above, button.rb, item.rb, and header.rb are all leaf nodes, while\naction_list is a sub-tree node.\n2. **Path**. A node's path is like its ID. It's an array of strings containing the current node's label and all the\nlabels of its ancestors, in order. In the example above, header.rb's path is [\"src\", \"action_list\", \"header.rb\"].\n\n## Static nodes\n\nThe `TreeView` component allows items to be provided statically or loaded dynamically from the server.\nProviding items statically is done using the `leaf` and `sub_tree` slots:\n\n```erb\n<%= render(Primer::OpenProject::TreeView.new) do |tree| %>\n <% tree.with_sub_tree(label: \"Directory\") do |sub_tree| %>\n <% sub_tree.with_leaf(label: \"File 1\")\n <% end %>\n <% tree.with_leaf(label: \"File 2\") %>\n<% end %>\n```\n\n## Dynamic nodes\n\nTree nodes can also be fetched dynamically from the server and will require creating a Rails controller action\nto respond with the list of nodes. Unlike other Primer components, `TreeView` allows the programmer to specify\nloading behavior on a per-sub-tree basis, i.e. each sub-tree must specify how its nodes are loaded. To load nodes\ndynamically for a given sub-tree, configure it with either a loading spinner or a loading skeleton, and provide\nthe URL to fetch nodes from:\n\n```erb\n<%= render(Primer::OpenProject::TreeView.new) do |tree| %>\n <% tree.with_sub_tree(label: \"Directory\") do |sub_tree| %>\n <% sub_tree.with_loading_spinner(src: tree_view_items_path) %>\n <% end %>\n<% end %>\n```\n\nDefine a controller action to serve the list of nodes. The `TreeView` component automatically includes the\nsub-tree's path as a GET parameter, encoded as a JSON array.\n\n```ruby\nclass TreeViewItemsController < ApplicationController\n def show\n @path = JSON.parse(params[:path])\n @results = get_tree_items(starting_at: path)\n end\nend\n```\n\nResponses must be HTML fragments, eg. have a content type of `text/html+fragment`. This content type isn't\navailable by default in Rails, so you may have to register it eg. in an initializer:\n\n```ruby\nMime::Type.register(\"text/fragment+html\", :html_fragment)\n```\n\nRender a `Primer::OpenProject::TreeView::SubTree` in the action's template, tree_view_items/show.html_fragment.erb:\n\n```erb\n<%= render(Primer::OpenProject::TreeView::SubTree.new(path: @path)) do |tree| %>\n <% tree.with_leaf(...) %>\n <% tree.with_sub_tree(...) do |sub_tree| %>\n ...\n <% end %>\n<% end %>\n```\n\n### JavaScript API\n\n`TreeView`s render a `<tree-view>` custom element that exposes behavior to the client.\n\n|Name |Notes |\n|:-----------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|\n|`getNodePath(node: Element): string[]` |Returns the path to the given node. |\n|`getNodeType(node: Element): TreeViewNodeType | null` |Returns either `\"leaf\"` or `\"sub-tree\"`. |\n|`markCurrentAtPath(path: string[])` |Marks the node as the \"current\" node, which appears visually distinct from other nodes. |\n|`get currentNode(): HTMLLIElement | null` |Returns the current node. |\n|`expandAtPath(path: string[])` |Expands the sub-tree at `path`. |\n|`collapseAtPath(path: string[])` |Collapses the sub-tree at `path`. |\n|`toggleAtPath(path: string[])` |If the sub-tree at `path` is collapsed, this function expands it, and vice-versa. |\n|`checkAtPath(path: string[])` |If the node at `path` has a checkbox, this function checks it. |\n|`uncheckAtPath(path: string[])` |If the node at `path` has a checkbox, this function unchecks it. |\n|`toggleCheckedAtPath(path: string[])` |If the sub-tree at `path` is checked, this function unchecks it, and vice-versa. |\n|`checkedValueAtPath(path: string[]): TreeViewCheckedValue` |Returns `\"true\"` (all child nodes are checked), `\"false\"` (no child nodes are checked), or `\"mixed\"` (some child nodes are checked, some are not).|\n|`nodeAtPath(path: string[], selector?: string): Element | null` |Returns the node for the given `path`, either a leaf node or sub-tree node. |\n|`subTreeAtPath(path: string[]): TreeViewSubTreeNodeElement | null`|Returns the sub-tree at the given `path`, if it exists. |\n|`leafAtPath(path: string[]): HTMLLIElement | null` |Returns the leaf node at the given `path`, if it exists. |\n|`getNodeCheckedValue(node: Element): TreeViewCheckedValue` |The same as `checkedValueAtPath`, but accepts a node instead of a path. |\n\n#### Events\n\nThe events enumerated below include node information by way of the `TreeViewNodeInfo` object, which has the\nfollowing signature:\n\n```typescript\ntype TreeViewNodeType = 'leaf' | 'sub-tree'\ntype TreeViewCheckedValue = 'true' | 'false' | 'mixed'\n\ntype TreeViewNodeInfo = {\n node: Element\n type: TreeViewNodeType\n path: string[]\n checkedValue: TreeViewCheckedValue\n previousCheckedValue: TreeViewCheckedValue\n}\n```\n\n|Name |Type |Bubbles |Cancelable |\n|:----------------------------|:------------------------------------------|:-------|:----------|\n|`treeViewNodeActivated` |`CustomEvent<TreeViewNodeInfo>` |Yes |No |\n|`treeViewBeforeNodeActivated`|`CustomEvent<TreeViewNodeInfo>` |Yes |Yes |\n|`treeViewNodeExpanded` |`CustomEvent<TreeViewNodeInfo>>` |Yes |No |\n|`treeViewNodeCollapsed` |`CustomEvent<TreeViewNodeInfo>>` |Yes |No |\n|`treeViewNodeChecked` |`CustomEvent<TreeViewNodeInfo[]>` |Yes |Yes |\n|`treeViewBeforeNodeChecked` |`CustomEvent<TreeViewNodeInfo[]>` |Yes |No |\n\n_Item activation_\n\nThe `<tree-view>` element fires an `treeViewNodeActivated` event whenever a node is activated (eg. clicked)\nvia the mouse or keyboard.\n\nThe `treeViewBeforeNodeActivated` event fires before a node is activated. Canceling this event will prevent the\nnode from being activated.\n\n```typescript\ndocument.querySelector(\"select-panel\").addEventListener(\n \"treeViewBeforeNodeActivated\",\n (event: CustomEvent<TreeViewNodeInfo>) => {\n event.preventDefault() // Cancel the event to prevent activation (eg. expanding/collapsing)\n }\n)\n```\n\n_Item checking/unchecking_\n\nThe `tree-view` element fires a `treeViewNodeChecked` event whenever a node is checked or unchecked.\n\nThe `treeViewBeforeNodeChecked` event fires before a node is checked or unchecked. Canceling this event will\nprevent the check/uncheck operation.\n\n```typescript\ndocument.querySelector(\"select-panel\").addEventListener(\n \"treeViewBeforeNodeChecked\",\n (event: CustomEvent<TreeViewNodeInfo[]>) => {\n event.preventDefault() // Cancel the event to prevent activation (eg. expanding/collapsing)\n }\n)\n```\n\nBecause checking or unchecking a sub-tree results in the checking or unchecking of all its children recursively,\nboth the `treeViewNodeChecked` and `treeViewBeforeNodeChecked` events provide an array of `TreeViewNodeInfo`\nobjects, which contain entries for every modified node in the tree.",
|
20205
|
+
"accessibility_docs": null,
|
20206
|
+
"is_form_component": false,
|
20207
|
+
"is_published": true,
|
20208
|
+
"requires_js": false,
|
20209
|
+
"component": "OpenProject::TreeView",
|
20210
|
+
"status": "alpha",
|
20211
|
+
"a11y_reviewed": false,
|
20212
|
+
"short_name": "OpenProjectTreeView",
|
20213
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/tree_view.rb",
|
20214
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/tree_view/default/",
|
20215
|
+
"parameters": [
|
20216
|
+
{
|
20217
|
+
"name": "system_arguments",
|
20218
|
+
"type": "Hash",
|
20219
|
+
"default": "N/A",
|
20220
|
+
"description": "{{link_to_system_arguments_docs}}."
|
20221
|
+
}
|
20222
|
+
],
|
20223
|
+
"slots": [
|
20224
|
+
{
|
20225
|
+
"name": "nodes",
|
20226
|
+
"description": null,
|
20227
|
+
"parameters": [
|
20228
|
+
|
20229
|
+
]
|
20230
|
+
}
|
20231
|
+
],
|
20232
|
+
"methods": [
|
20233
|
+
{
|
20234
|
+
"name": "with_leaf",
|
20235
|
+
"description": "Adds an leaf node to the tree. Leaf nodes are nodes that do not have children.",
|
20236
|
+
"parameters": [
|
20237
|
+
{
|
20238
|
+
"name": "component_klass",
|
20239
|
+
"type": "Class",
|
20240
|
+
"default": "N/A",
|
20241
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::OpenProject::TreeView::LeafNode{{/link_to_component}}"
|
20242
|
+
},
|
20243
|
+
{
|
20244
|
+
"name": "system_arguments",
|
20245
|
+
"type": "Hash",
|
20246
|
+
"default": "N/A",
|
20247
|
+
"description": "These arguments are forwarded to {{#link_to_component}}Primer::OpenProject::TreeView::LeafNode{{/link_to_component}}, or whatever class is passed as the `component_klass` argument."
|
20248
|
+
}
|
20249
|
+
],
|
20250
|
+
"return_types": [
|
20251
|
+
|
20252
|
+
]
|
20253
|
+
},
|
20254
|
+
{
|
20255
|
+
"name": "with_sub_tree",
|
20256
|
+
"description": "Adds a sub-tree node to the tree. Sub-trees are nodes that have children, which can be both leaf nodes and other sub-trees.",
|
20257
|
+
"parameters": [
|
20258
|
+
{
|
20259
|
+
"name": "component_klass",
|
20260
|
+
"type": "Class",
|
20261
|
+
"default": "N/A",
|
20262
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::OpenProject::TreeView::SubTreeNode{{/link_to_component}}"
|
20263
|
+
},
|
20264
|
+
{
|
20265
|
+
"name": "system_arguments",
|
20266
|
+
"type": "Hash",
|
20267
|
+
"default": "N/A",
|
20268
|
+
"description": "These arguments are forwarded to {{#link_to_component}}Primer::OpenProject::TreeView::SubTreeNode{{/link_to_component}}, or whatever class is passed as the `component_klass` argument."
|
20269
|
+
}
|
20270
|
+
],
|
20271
|
+
"return_types": [
|
20272
|
+
|
20273
|
+
]
|
20274
|
+
}
|
20275
|
+
],
|
20276
|
+
"previews": [
|
20277
|
+
{
|
20278
|
+
"preview_path": "primer/open_project/tree_view/default",
|
20279
|
+
"name": "default",
|
20280
|
+
"snapshot": "interactive",
|
20281
|
+
"skip_rules": {
|
20282
|
+
"wont_fix": [
|
20283
|
+
"region"
|
20284
|
+
],
|
20285
|
+
"will_fix": [
|
20286
|
+
"color-contrast"
|
20287
|
+
]
|
20288
|
+
}
|
20289
|
+
},
|
20290
|
+
{
|
20291
|
+
"preview_path": "primer/open_project/tree_view/playground",
|
20292
|
+
"name": "playground",
|
20293
|
+
"snapshot": "false",
|
20294
|
+
"skip_rules": {
|
20295
|
+
"wont_fix": [
|
20296
|
+
"region"
|
20297
|
+
],
|
20298
|
+
"will_fix": [
|
20299
|
+
"color-contrast"
|
20300
|
+
]
|
20301
|
+
}
|
20302
|
+
},
|
20303
|
+
{
|
20304
|
+
"preview_path": "primer/open_project/tree_view/empty",
|
20305
|
+
"name": "empty",
|
20306
|
+
"snapshot": "interactive",
|
20307
|
+
"skip_rules": {
|
20308
|
+
"wont_fix": [
|
20309
|
+
"region"
|
20310
|
+
],
|
20311
|
+
"will_fix": [
|
20312
|
+
"color-contrast"
|
20313
|
+
]
|
20314
|
+
}
|
20315
|
+
},
|
20316
|
+
{
|
20317
|
+
"preview_path": "primer/open_project/tree_view/loading_failure",
|
20318
|
+
"name": "loading_failure",
|
20319
|
+
"snapshot": "interactive",
|
20320
|
+
"skip_rules": {
|
20321
|
+
"wont_fix": [
|
20322
|
+
"region"
|
20323
|
+
],
|
20324
|
+
"will_fix": [
|
20325
|
+
"color-contrast"
|
20326
|
+
]
|
20327
|
+
}
|
20328
|
+
},
|
20329
|
+
{
|
20330
|
+
"preview_path": "primer/open_project/tree_view/loading_spinner",
|
20331
|
+
"name": "loading_spinner",
|
20332
|
+
"snapshot": "interactive",
|
20333
|
+
"skip_rules": {
|
20334
|
+
"wont_fix": [
|
20335
|
+
"region"
|
20336
|
+
],
|
20337
|
+
"will_fix": [
|
20338
|
+
"color-contrast"
|
20339
|
+
]
|
20340
|
+
}
|
20341
|
+
},
|
20342
|
+
{
|
20343
|
+
"preview_path": "primer/open_project/tree_view/loading_skeleton",
|
20344
|
+
"name": "loading_skeleton",
|
20345
|
+
"snapshot": "interactive",
|
20346
|
+
"skip_rules": {
|
20347
|
+
"wont_fix": [
|
20348
|
+
"region"
|
20349
|
+
],
|
20350
|
+
"will_fix": [
|
20351
|
+
"color-contrast"
|
20352
|
+
]
|
20353
|
+
}
|
20354
|
+
},
|
20355
|
+
{
|
20356
|
+
"preview_path": "primer/open_project/tree_view/leaf_node_playground",
|
20357
|
+
"name": "leaf_node_playground",
|
20358
|
+
"snapshot": "false",
|
20359
|
+
"skip_rules": {
|
20360
|
+
"wont_fix": [
|
20361
|
+
"region"
|
20362
|
+
],
|
20363
|
+
"will_fix": [
|
20364
|
+
"color-contrast"
|
20365
|
+
]
|
20366
|
+
}
|
20367
|
+
}
|
20368
|
+
],
|
20369
|
+
"subcomponents": [
|
20370
|
+
|
20371
|
+
]
|
20372
|
+
},
|
20373
|
+
{
|
20374
|
+
"fully_qualified_name": "Primer::OpenProject::TreeView::Icon",
|
20375
|
+
"description": "An icon for a `TreeView` node.\n\nThis component is part of the {{#link_to_component}}Primer::OpenProject::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
20376
|
+
"accessibility_docs": null,
|
20377
|
+
"is_form_component": false,
|
20378
|
+
"is_published": true,
|
20379
|
+
"requires_js": false,
|
20380
|
+
"component": "OpenProject::TreeView::Icon",
|
20381
|
+
"status": "alpha",
|
20382
|
+
"a11y_reviewed": false,
|
20383
|
+
"short_name": "OpenProjectTreeViewIcon",
|
20384
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/tree_view/icon.rb",
|
20385
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/tree_view/icon/default/",
|
20386
|
+
"parameters": [
|
20387
|
+
{
|
20388
|
+
"name": "system_arguments",
|
20389
|
+
"type": "Hash",
|
20390
|
+
"default": "N/A",
|
20391
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}."
|
20392
|
+
}
|
20393
|
+
],
|
20394
|
+
"slots": [
|
20395
|
+
|
20396
|
+
],
|
20397
|
+
"methods": [
|
20398
|
+
|
20399
|
+
],
|
20400
|
+
"previews": [
|
20401
|
+
|
20402
|
+
],
|
20403
|
+
"subcomponents": [
|
20404
|
+
|
20405
|
+
]
|
20406
|
+
},
|
20407
|
+
{
|
20408
|
+
"fully_qualified_name": "Primer::OpenProject::TreeView::IconPair",
|
20409
|
+
"description": "A pair of icons for a `TreeView` sub-tree that displays distinct icons when the sub-tree is\nexpanded and collapsed.\n\nThis component is part of the {{#link_to_component}}Primer::OpenProject::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
20410
|
+
"accessibility_docs": null,
|
20411
|
+
"is_form_component": false,
|
20412
|
+
"is_published": true,
|
20413
|
+
"requires_js": false,
|
20414
|
+
"component": "OpenProject::TreeView::IconPair",
|
20415
|
+
"status": "alpha",
|
20416
|
+
"a11y_reviewed": false,
|
20417
|
+
"short_name": "OpenProjectTreeViewIconPair",
|
20418
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/tree_view/icon_pair.rb",
|
20419
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/tree_view/icon_pair/default/",
|
20420
|
+
"parameters": [
|
20421
|
+
{
|
20422
|
+
"name": "expanded",
|
20423
|
+
"type": "Boolean",
|
20424
|
+
"default": "`false`",
|
20425
|
+
"description": "If true, the expanded icon is shown and the collapsed icon is hidden, etc."
|
20426
|
+
},
|
20427
|
+
{
|
20428
|
+
"name": "system_arguments",
|
20429
|
+
"type": "Hash",
|
20430
|
+
"default": "N/A",
|
20431
|
+
"description": "{{link_to_system_arguments_docs}}"
|
20432
|
+
}
|
20433
|
+
],
|
20434
|
+
"slots": [
|
20435
|
+
{
|
20436
|
+
"name": "expanded_icon",
|
20437
|
+
"description": "The expanded icon.",
|
20438
|
+
"parameters": [
|
20439
|
+
{
|
20440
|
+
"name": "system_arguments",
|
20441
|
+
"type": "Hash",
|
20442
|
+
"default": "N/A",
|
20443
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::Icon{{/link_to_component}}."
|
20444
|
+
}
|
20445
|
+
]
|
20446
|
+
},
|
20447
|
+
{
|
20448
|
+
"name": "collapsed_icon",
|
20449
|
+
"description": "The collapsed icon.",
|
20450
|
+
"parameters": [
|
20451
|
+
{
|
20452
|
+
"name": "system_arguments",
|
20453
|
+
"type": "Hash",
|
20454
|
+
"default": "N/A",
|
20455
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::Icon{{/link_to_component}}."
|
20456
|
+
}
|
20457
|
+
]
|
20458
|
+
}
|
20459
|
+
],
|
20460
|
+
"methods": [
|
20461
|
+
{
|
20462
|
+
"name": "expanded",
|
20463
|
+
"description": "Whether or not this icon is expanded.",
|
20464
|
+
"parameters": [
|
20465
|
+
|
20466
|
+
],
|
20467
|
+
"return_types": [
|
20468
|
+
"Boolean"
|
20469
|
+
]
|
20470
|
+
},
|
20471
|
+
{
|
20472
|
+
"name": "expanded?",
|
20473
|
+
"description": "Whether or not this icon is expanded.",
|
20474
|
+
"parameters": [
|
20475
|
+
|
20476
|
+
],
|
20477
|
+
"return_types": [
|
20478
|
+
"Boolean"
|
20479
|
+
]
|
20480
|
+
}
|
20481
|
+
],
|
20482
|
+
"previews": [
|
20483
|
+
|
20484
|
+
],
|
20485
|
+
"subcomponents": [
|
20486
|
+
|
20487
|
+
]
|
20488
|
+
},
|
20489
|
+
{
|
20490
|
+
"fully_qualified_name": "Primer::OpenProject::TreeView::LeadingAction",
|
20491
|
+
"description": "The leading action for `TreeView` nodes.\n\nThis component is part of the {{#link_to_component}}Primer::OpenProject::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
20492
|
+
"accessibility_docs": null,
|
20493
|
+
"is_form_component": false,
|
20494
|
+
"is_published": true,
|
20495
|
+
"requires_js": false,
|
20496
|
+
"component": "OpenProject::TreeView::LeadingAction",
|
20497
|
+
"status": "alpha",
|
20498
|
+
"a11y_reviewed": false,
|
20499
|
+
"short_name": "OpenProjectTreeViewLeadingAction",
|
20500
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/tree_view/leading_action.rb",
|
20501
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/tree_view/leading_action/default/",
|
20502
|
+
"parameters": [
|
20503
|
+
{
|
20504
|
+
"name": "action",
|
20505
|
+
"type": "ViewComponent::Base",
|
20506
|
+
"default": "N/A",
|
20507
|
+
"description": "A component or other renderable to use as the action button etc."
|
20508
|
+
}
|
20509
|
+
],
|
20510
|
+
"slots": [
|
20511
|
+
|
20512
|
+
],
|
20513
|
+
"methods": [
|
20514
|
+
|
20515
|
+
],
|
20516
|
+
"previews": [
|
20517
|
+
|
20518
|
+
],
|
20519
|
+
"subcomponents": [
|
20520
|
+
|
20521
|
+
]
|
20522
|
+
},
|
20523
|
+
{
|
20524
|
+
"fully_qualified_name": "Primer::OpenProject::TreeView::LeafNode",
|
20525
|
+
"description": "A `TreeView` leaf node.\n\nThis component is part of the {{#link_to_component}}Primer::OpenProject::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
20526
|
+
"accessibility_docs": null,
|
20527
|
+
"is_form_component": false,
|
20528
|
+
"is_published": true,
|
20529
|
+
"requires_js": false,
|
20530
|
+
"component": "OpenProject::TreeView::LeafNode",
|
20531
|
+
"status": "alpha",
|
20532
|
+
"a11y_reviewed": false,
|
20533
|
+
"short_name": "OpenProjectTreeViewLeafNode",
|
20534
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/tree_view/leaf_node.rb",
|
20535
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/tree_view/leaf_node/default/",
|
20536
|
+
"parameters": [
|
20537
|
+
{
|
20538
|
+
"name": "label",
|
20539
|
+
"type": "String",
|
20540
|
+
"default": "N/A",
|
20541
|
+
"description": "The node's label, i.e. it's textual content."
|
20542
|
+
},
|
20543
|
+
{
|
20544
|
+
"name": "system_arguments",
|
20545
|
+
"type": "Hash",
|
20546
|
+
"default": "N/A",
|
20547
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::Node{{/link_to_component}}."
|
20548
|
+
}
|
20549
|
+
],
|
20550
|
+
"slots": [
|
20551
|
+
{
|
20552
|
+
"name": "leading_visual",
|
20553
|
+
"description": null,
|
20554
|
+
"parameters": [
|
20555
|
+
|
20556
|
+
]
|
20557
|
+
},
|
20558
|
+
{
|
20559
|
+
"name": "leading_action",
|
20560
|
+
"description": null,
|
20561
|
+
"parameters": [
|
20562
|
+
|
20563
|
+
]
|
20564
|
+
},
|
20565
|
+
{
|
20566
|
+
"name": "trailing_visual",
|
20567
|
+
"description": null,
|
20568
|
+
"parameters": [
|
20569
|
+
|
20570
|
+
]
|
20571
|
+
}
|
20572
|
+
],
|
20573
|
+
"methods": [
|
20574
|
+
{
|
20575
|
+
"name": "with_leading_visual_icon",
|
20576
|
+
"description": "Adds a leading visual icon rendered to the left of the node's label.",
|
20577
|
+
"parameters": [
|
20578
|
+
{
|
20579
|
+
"name": "label",
|
20580
|
+
"type": "String",
|
20581
|
+
"default": "`nil`",
|
20582
|
+
"description": "A label describing the visual, displayed only to screen readers."
|
20583
|
+
},
|
20584
|
+
{
|
20585
|
+
"name": "system_arguments",
|
20586
|
+
"type": "Hash",
|
20587
|
+
"default": "N/A",
|
20588
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::Icon{{/link_to_component}}."
|
20589
|
+
}
|
20590
|
+
],
|
20591
|
+
"return_types": [
|
20592
|
+
|
20593
|
+
]
|
20594
|
+
},
|
20595
|
+
{
|
20596
|
+
"name": "with_leading_action_button",
|
20597
|
+
"description": "Adds a leading action rendered to the left of the node's label and any leading visuals or checkboxes.",
|
20598
|
+
"parameters": [
|
20599
|
+
{
|
20600
|
+
"name": "system_arguments",
|
20601
|
+
"type": "Hash",
|
20602
|
+
"default": "N/A",
|
20603
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::IconButton{{/link_to_component}}."
|
20604
|
+
}
|
20605
|
+
],
|
20606
|
+
"return_types": [
|
20607
|
+
|
20608
|
+
]
|
20609
|
+
},
|
20610
|
+
{
|
20611
|
+
"name": "with_trailing_visual_icon",
|
20612
|
+
"description": "Adds a trailing visual icon rendered to the right of the node's label.",
|
20613
|
+
"parameters": [
|
20614
|
+
{
|
20615
|
+
"name": "label",
|
20616
|
+
"type": "String",
|
20617
|
+
"default": "`nil`",
|
20618
|
+
"description": "A label describing the visual, displayed only to screen readers."
|
20619
|
+
},
|
20620
|
+
{
|
20621
|
+
"name": "system_arguments",
|
20622
|
+
"type": "Hash",
|
20623
|
+
"default": "N/A",
|
20624
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::Icon{{/link_to_component}}."
|
20625
|
+
}
|
20626
|
+
],
|
20627
|
+
"return_types": [
|
20628
|
+
|
20629
|
+
]
|
20630
|
+
}
|
20631
|
+
],
|
20632
|
+
"previews": [
|
20633
|
+
|
20634
|
+
],
|
20635
|
+
"subcomponents": [
|
20636
|
+
|
20637
|
+
]
|
20638
|
+
},
|
20639
|
+
{
|
20640
|
+
"fully_qualified_name": "Primer::OpenProject::TreeView::LoadingFailureMessage",
|
20641
|
+
"description": "A `TreeView` loading failure message.\n\nThis component is part of the {{#link_to_component}}Primer::OpenProject::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
20642
|
+
"accessibility_docs": null,
|
20643
|
+
"is_form_component": false,
|
20644
|
+
"is_published": true,
|
20645
|
+
"requires_js": false,
|
20646
|
+
"component": "OpenProject::TreeView::LoadingFailureMessage",
|
20647
|
+
"status": "alpha",
|
20648
|
+
"a11y_reviewed": false,
|
20649
|
+
"short_name": "OpenProjectTreeViewLoadingFailureMessage",
|
20650
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/tree_view/loading_failure_message.rb",
|
20651
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/tree_view/loading_failure_message/default/",
|
20652
|
+
"parameters": [
|
20653
|
+
{
|
20654
|
+
"name": "text",
|
20655
|
+
"type": "String",
|
20656
|
+
"default": "`Something went wrong`",
|
20657
|
+
"description": "The failure message to display."
|
20658
|
+
},
|
20659
|
+
{
|
20660
|
+
"name": "retry_button_label",
|
20661
|
+
"type": "String",
|
20662
|
+
"default": "`Retry`",
|
20663
|
+
"description": "The text shown on the retry button."
|
20664
|
+
},
|
20665
|
+
{
|
20666
|
+
"name": "system_arguments",
|
20667
|
+
"type": "Hash",
|
20668
|
+
"default": "N/A",
|
20669
|
+
"description": "{{link_to_system_arguments_docs}}"
|
20670
|
+
}
|
20671
|
+
],
|
20672
|
+
"slots": [
|
20673
|
+
|
20674
|
+
],
|
20675
|
+
"methods": [
|
20676
|
+
|
20677
|
+
],
|
20678
|
+
"previews": [
|
20679
|
+
|
20680
|
+
],
|
20681
|
+
"subcomponents": [
|
20682
|
+
|
20683
|
+
]
|
20684
|
+
},
|
20685
|
+
{
|
20686
|
+
"fully_qualified_name": "Primer::OpenProject::TreeView::Node",
|
20687
|
+
"description": "A generic `TreeView` node.\n\nThis component is part of the {{#link_to_component}}Primer::OpenProject::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
20688
|
+
"accessibility_docs": null,
|
20689
|
+
"is_form_component": false,
|
20690
|
+
"is_published": true,
|
20691
|
+
"requires_js": false,
|
20692
|
+
"component": "OpenProject::TreeView::Node",
|
20693
|
+
"status": "alpha",
|
20694
|
+
"a11y_reviewed": false,
|
20695
|
+
"short_name": "OpenProjectTreeViewNode",
|
20696
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/tree_view/node.rb",
|
20697
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/tree_view/node/default/",
|
20698
|
+
"parameters": [
|
20699
|
+
{
|
20700
|
+
"name": "path",
|
20701
|
+
"type": "Array<String>",
|
20702
|
+
"default": "N/A",
|
20703
|
+
"description": "The node's \"path,\" i.e. this node's label and the labels of all its ancestors. This node should be reachable by traversing the tree following this path."
|
20704
|
+
},
|
20705
|
+
{
|
20706
|
+
"name": "current",
|
20707
|
+
"type": "Boolean",
|
20708
|
+
"default": "`false`",
|
20709
|
+
"description": "Whether or not this node is the current node. The current node is styled differently than regular nodes and is the first element that receives focus when tabbing to the `TreeView` component."
|
20710
|
+
},
|
20711
|
+
{
|
20712
|
+
"name": "select_variant",
|
20713
|
+
"type": "Symbol",
|
20714
|
+
"default": "`:none`",
|
20715
|
+
"description": "Controls the type of checkbox that appears. One of `:multiple` or `:none`."
|
20716
|
+
},
|
20717
|
+
{
|
20718
|
+
"name": "checked",
|
20719
|
+
"type": "Boolean | String",
|
20720
|
+
"default": "`false`",
|
20721
|
+
"description": "The checked state of the node's checkbox. One of `false`, `mixed`, or `true`."
|
20722
|
+
},
|
20723
|
+
{
|
20724
|
+
"name": "system_arguments",
|
20725
|
+
"type": "Hash",
|
20726
|
+
"default": "N/A",
|
20727
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::ActionList{{/link_to_component}}."
|
20728
|
+
}
|
20729
|
+
],
|
20730
|
+
"slots": [
|
20731
|
+
{
|
20732
|
+
"name": "leading_action",
|
20733
|
+
"description": "Generic leading action slot",
|
20734
|
+
"parameters": [
|
20735
|
+
|
20736
|
+
]
|
20737
|
+
},
|
20738
|
+
{
|
20739
|
+
"name": "leading_visual",
|
20740
|
+
"description": "Generic leading visual slot",
|
20741
|
+
"parameters": [
|
20742
|
+
|
20743
|
+
]
|
20744
|
+
},
|
20745
|
+
{
|
20746
|
+
"name": "trailing_visual",
|
20747
|
+
"description": "Generic trailing visual slot",
|
20748
|
+
"parameters": [
|
20749
|
+
|
20750
|
+
]
|
20751
|
+
},
|
20752
|
+
{
|
20753
|
+
"name": "toggle",
|
20754
|
+
"description": "Generic toggle button slot",
|
20755
|
+
"parameters": [
|
20756
|
+
|
20757
|
+
]
|
20758
|
+
},
|
20759
|
+
{
|
20760
|
+
"name": "text_content",
|
20761
|
+
"description": "Generic text content slot (for node's label)",
|
20762
|
+
"parameters": [
|
20763
|
+
|
20764
|
+
]
|
20765
|
+
}
|
20766
|
+
],
|
20767
|
+
"methods": [
|
20768
|
+
{
|
20769
|
+
"name": "current",
|
20770
|
+
"description": "Wether or not this node is the current node.",
|
20771
|
+
"parameters": [
|
20772
|
+
|
20773
|
+
],
|
20774
|
+
"return_types": [
|
20775
|
+
"Boolean"
|
20776
|
+
]
|
20777
|
+
},
|
20778
|
+
{
|
20779
|
+
"name": "current?",
|
20780
|
+
"description": "Wether or not this node is the current node.",
|
20781
|
+
"parameters": [
|
20782
|
+
|
20783
|
+
],
|
20784
|
+
"return_types": [
|
20785
|
+
"Boolean"
|
20786
|
+
]
|
20787
|
+
},
|
20788
|
+
{
|
20789
|
+
"name": "checked",
|
20790
|
+
"description": "This node's checked state.",
|
20791
|
+
"parameters": [
|
20792
|
+
|
20793
|
+
],
|
20794
|
+
"return_types": [
|
20795
|
+
"String"
|
20796
|
+
]
|
20797
|
+
},
|
20798
|
+
{
|
20799
|
+
"name": "select_variant",
|
20800
|
+
"description": "This node's select variant (i.e. check box variant).",
|
20801
|
+
"parameters": [
|
20802
|
+
|
20803
|
+
],
|
20804
|
+
"return_types": [
|
20805
|
+
"Symbol"
|
20806
|
+
]
|
20807
|
+
},
|
20808
|
+
{
|
20809
|
+
"name": "level",
|
20810
|
+
"description": "The numeric depth of this node.",
|
20811
|
+
"parameters": [
|
20812
|
+
|
20813
|
+
],
|
20814
|
+
"return_types": [
|
20815
|
+
"Integer"
|
20816
|
+
]
|
20817
|
+
},
|
20818
|
+
{
|
20819
|
+
"name": "merge_system_arguments!",
|
20820
|
+
"description": "Merges the given arguments into the current hash of system arguments provided when the component was\ninitially constructed. This method can be used to add additional arguments just before rendering.",
|
20821
|
+
"parameters": [
|
20822
|
+
{
|
20823
|
+
"name": "other_arguments",
|
20824
|
+
"type": "Hash",
|
20825
|
+
"default": "N/A",
|
20826
|
+
"description": "The other hash of system arguments to merge into the current one."
|
20827
|
+
}
|
20828
|
+
],
|
20829
|
+
"return_types": [
|
20830
|
+
|
20831
|
+
]
|
20832
|
+
}
|
20833
|
+
],
|
20834
|
+
"previews": [
|
20835
|
+
|
20836
|
+
],
|
20837
|
+
"subcomponents": [
|
20838
|
+
|
20839
|
+
]
|
20840
|
+
},
|
20841
|
+
{
|
20842
|
+
"fully_qualified_name": "Primer::OpenProject::TreeView::SkeletonLoader",
|
20843
|
+
"description": "Renders a loading skeleton for a `TreeView` sub-tree node.\n\nThis component is part of the {{#link_to_component}}Primer::OpenProject::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
20844
|
+
"accessibility_docs": null,
|
20845
|
+
"is_form_component": false,
|
20846
|
+
"is_published": true,
|
20847
|
+
"requires_js": false,
|
20848
|
+
"component": "OpenProject::TreeView::SkeletonLoader",
|
20849
|
+
"status": "alpha",
|
20850
|
+
"a11y_reviewed": false,
|
20851
|
+
"short_name": "OpenProjectTreeViewSkeletonLoader",
|
20852
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/tree_view/skeleton_loader.rb",
|
20853
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/tree_view/skeleton_loader/default/",
|
20854
|
+
"parameters": [
|
20855
|
+
{
|
20856
|
+
"name": "src",
|
20857
|
+
"type": "String",
|
20858
|
+
"default": "N/A",
|
20859
|
+
"description": "The URL to fetch nodes from."
|
20860
|
+
},
|
20861
|
+
{
|
20862
|
+
"name": "count",
|
20863
|
+
"type": "Integer",
|
20864
|
+
"default": "`3`",
|
20865
|
+
"description": "The number of skeleton nodes to render."
|
20866
|
+
},
|
20867
|
+
{
|
20868
|
+
"name": "system_arguments",
|
20869
|
+
"type": "Hash",
|
20870
|
+
"default": "N/A",
|
20871
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::SubTreeContainer{{/link_to_component}}."
|
20872
|
+
}
|
20873
|
+
],
|
20874
|
+
"slots": [
|
20875
|
+
{
|
20876
|
+
"name": "loading_failure_message",
|
20877
|
+
"description": "The failure message that appears if loading nodes from the server fails.",
|
20878
|
+
"parameters": [
|
20879
|
+
{
|
20880
|
+
"name": "system_arguments",
|
20881
|
+
"type": "Hash",
|
20882
|
+
"default": "N/A",
|
20883
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::LoadingFailureMessage{{/link_to_component}}."
|
20884
|
+
}
|
20885
|
+
]
|
20886
|
+
}
|
20887
|
+
],
|
20888
|
+
"methods": [
|
20889
|
+
|
20890
|
+
],
|
20891
|
+
"previews": [
|
20892
|
+
|
20893
|
+
],
|
20894
|
+
"subcomponents": [
|
20895
|
+
|
20896
|
+
]
|
20897
|
+
},
|
20898
|
+
{
|
20899
|
+
"fully_qualified_name": "Primer::OpenProject::TreeView::SpinnerLoader",
|
20900
|
+
"description": "Renders a loading spinner for a `TreeView` sub-tree node.\n\nThis component is part of the {{#link_to_component}}Primer::OpenProject::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
20901
|
+
"accessibility_docs": null,
|
20902
|
+
"is_form_component": false,
|
20903
|
+
"is_published": true,
|
20904
|
+
"requires_js": false,
|
20905
|
+
"component": "OpenProject::TreeView::SpinnerLoader",
|
20906
|
+
"status": "alpha",
|
20907
|
+
"a11y_reviewed": false,
|
20908
|
+
"short_name": "OpenProjectTreeViewSpinnerLoader",
|
20909
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/tree_view/spinner_loader.rb",
|
20910
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/tree_view/spinner_loader/default/",
|
20911
|
+
"parameters": [
|
20912
|
+
{
|
20913
|
+
"name": "src",
|
20914
|
+
"type": "String",
|
20915
|
+
"default": "N/A",
|
20916
|
+
"description": "The URL to fetch nodes from."
|
20917
|
+
},
|
20918
|
+
{
|
20919
|
+
"name": "system_arguments",
|
20920
|
+
"type": "Hash",
|
20921
|
+
"default": "N/A",
|
20922
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::SubTreeContainer{{/link_to_component}}."
|
20923
|
+
}
|
20924
|
+
],
|
20925
|
+
"slots": [
|
20926
|
+
{
|
20927
|
+
"name": "loading_failure_message",
|
20928
|
+
"description": "The failure message that appears if loading nodes from the server fails.",
|
20929
|
+
"parameters": [
|
20930
|
+
{
|
20931
|
+
"name": "system_arguments",
|
20932
|
+
"type": "Hash",
|
20933
|
+
"default": "N/A",
|
20934
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::LoadingFailureMessage{{/link_to_component}}."
|
20935
|
+
}
|
20936
|
+
]
|
20937
|
+
}
|
20938
|
+
],
|
20939
|
+
"methods": [
|
20940
|
+
|
20941
|
+
],
|
20942
|
+
"previews": [
|
20943
|
+
|
20944
|
+
],
|
20945
|
+
"subcomponents": [
|
20946
|
+
|
20947
|
+
]
|
20948
|
+
},
|
20949
|
+
{
|
20950
|
+
"fully_qualified_name": "Primer::OpenProject::TreeView::SubTree",
|
20951
|
+
"description": "A `TreeView` sub-tree.\n\nThis component is part of the {{#link_to_component}}Primer::OpenProject::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
20952
|
+
"accessibility_docs": null,
|
20953
|
+
"is_form_component": false,
|
20954
|
+
"is_published": true,
|
20955
|
+
"requires_js": false,
|
20956
|
+
"component": "OpenProject::TreeView::SubTree",
|
20957
|
+
"status": "alpha",
|
20958
|
+
"a11y_reviewed": false,
|
20959
|
+
"short_name": "OpenProjectTreeViewSubTree",
|
20960
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/tree_view/sub_tree.rb",
|
20961
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/tree_view/sub_tree/default/",
|
20962
|
+
"parameters": [
|
20963
|
+
{
|
20964
|
+
"name": "system_arguments",
|
20965
|
+
"type": "Hash",
|
20966
|
+
"default": "N/A",
|
20967
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::SubTreeContainer{{/link_to_component}}."
|
20968
|
+
}
|
20969
|
+
],
|
20970
|
+
"slots": [
|
20971
|
+
{
|
20972
|
+
"name": "nodes",
|
20973
|
+
"description": null,
|
20974
|
+
"parameters": [
|
20975
|
+
|
20976
|
+
]
|
20977
|
+
},
|
20978
|
+
{
|
20979
|
+
"name": "loader",
|
20980
|
+
"description": null,
|
20981
|
+
"parameters": [
|
20982
|
+
|
20983
|
+
]
|
20984
|
+
},
|
20985
|
+
{
|
20986
|
+
"name": "no_items_message",
|
20987
|
+
"description": "The message to display if this sub-tree contains no children.",
|
20988
|
+
"parameters": [
|
20989
|
+
|
20990
|
+
]
|
20991
|
+
}
|
20992
|
+
],
|
20993
|
+
"methods": [
|
20994
|
+
{
|
20995
|
+
"name": "with_leaf",
|
20996
|
+
"description": "Adds an leaf node to the tree. Leaf nodes are nodes that do not have children.",
|
20997
|
+
"parameters": [
|
20998
|
+
{
|
20999
|
+
"name": "component_klass",
|
21000
|
+
"type": "Class",
|
21001
|
+
"default": "N/A",
|
21002
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::OpenProject::TreeView::LeafNode{{/link_to_component}}"
|
21003
|
+
},
|
21004
|
+
{
|
21005
|
+
"name": "system_arguments",
|
21006
|
+
"type": "Hash",
|
21007
|
+
"default": "N/A",
|
21008
|
+
"description": "These arguments are forwarded to {{#link_to_component}}Primer::OpenProject::TreeView::LeafNode{{/link_to_component}}, or whatever class is passed as the `component_klass` argument."
|
21009
|
+
}
|
21010
|
+
],
|
21011
|
+
"return_types": [
|
21012
|
+
|
21013
|
+
]
|
21014
|
+
},
|
21015
|
+
{
|
21016
|
+
"name": "with_sub_tree",
|
21017
|
+
"description": "Adds a sub-tree node to the tree. Sub-trees are nodes that have children, which can be both leaf nodes and other sub-trees.",
|
21018
|
+
"parameters": [
|
21019
|
+
{
|
21020
|
+
"name": "component_klass",
|
21021
|
+
"type": "Class",
|
21022
|
+
"default": "N/A",
|
21023
|
+
"description": "The class to use instead of the default {{#link_to_component}}Primer::OpenProject::TreeView::SubTreeNode{{/link_to_component}}"
|
21024
|
+
},
|
21025
|
+
{
|
21026
|
+
"name": "system_arguments",
|
21027
|
+
"type": "Hash",
|
21028
|
+
"default": "N/A",
|
21029
|
+
"description": "These arguments are forwarded to {{#link_to_component}}Primer::OpenProject::TreeView::SubTreeNode{{/link_to_component}}, or whatever class is passed as the `component_klass` argument."
|
21030
|
+
}
|
21031
|
+
],
|
21032
|
+
"return_types": [
|
21033
|
+
|
21034
|
+
]
|
21035
|
+
},
|
21036
|
+
{
|
21037
|
+
"name": "with_loading_spinner",
|
21038
|
+
"description": "Adds a loader to this sub-tree that displays a skeleton animation while nodes are fetched from the server.",
|
21039
|
+
"parameters": [
|
21040
|
+
{
|
21041
|
+
"name": "system_arguments",
|
21042
|
+
"type": "Hash",
|
21043
|
+
"default": "N/A",
|
21044
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::SkeletonLoader{{/link_to_component}}."
|
21045
|
+
}
|
21046
|
+
],
|
21047
|
+
"return_types": [
|
21048
|
+
|
21049
|
+
]
|
21050
|
+
}
|
21051
|
+
],
|
21052
|
+
"previews": [
|
21053
|
+
|
21054
|
+
],
|
21055
|
+
"subcomponents": [
|
21056
|
+
|
21057
|
+
]
|
21058
|
+
},
|
21059
|
+
{
|
21060
|
+
"fully_qualified_name": "Primer::OpenProject::TreeView::SubTreeContainer",
|
21061
|
+
"description": "This component is part of the {{#link_to_component}}Primer::OpenProject::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
21062
|
+
"accessibility_docs": null,
|
21063
|
+
"is_form_component": false,
|
21064
|
+
"is_published": true,
|
21065
|
+
"requires_js": false,
|
21066
|
+
"component": "OpenProject::TreeView::SubTreeContainer",
|
21067
|
+
"status": "alpha",
|
21068
|
+
"a11y_reviewed": false,
|
21069
|
+
"short_name": "OpenProjectTreeViewSubTreeContainer",
|
21070
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/tree_view/sub_tree_container.rb",
|
21071
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/tree_view/sub_tree_container/default/",
|
21072
|
+
"parameters": [
|
21073
|
+
{
|
21074
|
+
"name": "path",
|
21075
|
+
"type": "Array<String>",
|
21076
|
+
"default": "N/A",
|
21077
|
+
"description": "The path to this node."
|
21078
|
+
},
|
21079
|
+
{
|
21080
|
+
"name": "expanded",
|
21081
|
+
"type": "Boolean",
|
21082
|
+
"default": "`false`",
|
21083
|
+
"description": "Whether or not this sub-tree node renders expanded."
|
21084
|
+
},
|
21085
|
+
{
|
21086
|
+
"name": "system_arguments",
|
21087
|
+
"type": "Hash",
|
21088
|
+
"default": "N/A",
|
21089
|
+
"description": "{{link_to_system_arguments_docs}}"
|
21090
|
+
}
|
21091
|
+
],
|
21092
|
+
"slots": [
|
21093
|
+
|
21094
|
+
],
|
21095
|
+
"methods": [
|
21096
|
+
{
|
21097
|
+
"name": "path",
|
21098
|
+
"description": "The path to this node",
|
21099
|
+
"parameters": [
|
21100
|
+
|
21101
|
+
],
|
21102
|
+
"return_types": [
|
21103
|
+
"Array<String>"
|
21104
|
+
]
|
21105
|
+
},
|
21106
|
+
{
|
21107
|
+
"name": "expanded",
|
21108
|
+
"description": "Whether or not this sub-tree node renders expanded.",
|
21109
|
+
"parameters": [
|
21110
|
+
|
21111
|
+
],
|
21112
|
+
"return_types": [
|
21113
|
+
"Boolean"
|
21114
|
+
]
|
21115
|
+
},
|
21116
|
+
{
|
21117
|
+
"name": "expanded?",
|
21118
|
+
"description": "Whether or not this sub-tree node renders expanded.",
|
21119
|
+
"parameters": [
|
21120
|
+
|
21121
|
+
],
|
21122
|
+
"return_types": [
|
21123
|
+
"Boolean"
|
21124
|
+
]
|
21125
|
+
}
|
21126
|
+
],
|
21127
|
+
"previews": [
|
21128
|
+
|
21129
|
+
],
|
21130
|
+
"subcomponents": [
|
21131
|
+
|
21132
|
+
]
|
21133
|
+
},
|
21134
|
+
{
|
21135
|
+
"fully_qualified_name": "Primer::OpenProject::TreeView::SubTreeNode",
|
21136
|
+
"description": "A `TreeView` sub-tree node.\n\nThis component is part of the {{#link_to_component}}Primer::OpenProject::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
21137
|
+
"accessibility_docs": null,
|
21138
|
+
"is_form_component": false,
|
21139
|
+
"is_published": true,
|
21140
|
+
"requires_js": false,
|
21141
|
+
"component": "OpenProject::TreeView::SubTreeNode",
|
21142
|
+
"status": "alpha",
|
21143
|
+
"a11y_reviewed": false,
|
21144
|
+
"short_name": "OpenProjectTreeViewSubTreeNode",
|
21145
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/tree_view/sub_tree_node.rb",
|
21146
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/tree_view/sub_tree_node/default/",
|
21147
|
+
"parameters": [
|
21148
|
+
{
|
21149
|
+
"name": "label",
|
21150
|
+
"type": "String",
|
21151
|
+
"default": "N/A",
|
21152
|
+
"description": "The node's label, i.e. it's textual content."
|
21153
|
+
},
|
21154
|
+
{
|
21155
|
+
"name": "path",
|
21156
|
+
"type": "Array<String>",
|
21157
|
+
"default": "N/A",
|
21158
|
+
"description": "The node's \"path,\" i.e. this node's label and the labels of all its ancestors. This node should be reachable by traversing the tree following this path."
|
21159
|
+
},
|
21160
|
+
{
|
21161
|
+
"name": "expanded",
|
21162
|
+
"type": "Boolean",
|
21163
|
+
"default": "`false`",
|
21164
|
+
"description": "Whether or not this sub-tree should be rendered expanded."
|
21165
|
+
},
|
21166
|
+
{
|
21167
|
+
"name": "select_strategy",
|
21168
|
+
"type": "Symbol",
|
21169
|
+
"default": "`:descendants`",
|
21170
|
+
"description": "What should happen when this sub-tree node is checked. One of `:descendants` or `:self`."
|
21171
|
+
},
|
21172
|
+
{
|
21173
|
+
"name": "system_arguments",
|
21174
|
+
"type": "Hash",
|
21175
|
+
"default": "N/A",
|
21176
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::Node{{/link_to_component}}."
|
21177
|
+
}
|
21178
|
+
],
|
21179
|
+
"slots": [
|
21180
|
+
{
|
21181
|
+
"name": "leading_visual",
|
21182
|
+
"description": null,
|
21183
|
+
"parameters": [
|
21184
|
+
|
21185
|
+
]
|
21186
|
+
},
|
21187
|
+
{
|
21188
|
+
"name": "leading_action",
|
21189
|
+
"description": null,
|
21190
|
+
"parameters": [
|
21191
|
+
|
21192
|
+
]
|
21193
|
+
},
|
21194
|
+
{
|
21195
|
+
"name": "trailing_visual",
|
21196
|
+
"description": null,
|
21197
|
+
"parameters": [
|
21198
|
+
|
21199
|
+
]
|
21200
|
+
}
|
21201
|
+
],
|
21202
|
+
"methods": [
|
21203
|
+
{
|
21204
|
+
"name": "with_leading_visual_icon",
|
21205
|
+
"description": "Adds a leading visual icon rendered to the left of the node's label.",
|
21206
|
+
"parameters": [
|
21207
|
+
{
|
21208
|
+
"name": "label",
|
21209
|
+
"type": "String",
|
21210
|
+
"default": "`nil`",
|
21211
|
+
"description": "A label describing the visual, displayed only to screen readers."
|
21212
|
+
},
|
21213
|
+
{
|
21214
|
+
"name": "system_arguments",
|
21215
|
+
"type": "Hash",
|
21216
|
+
"default": "N/A",
|
21217
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::Icon{{/link_to_component}}."
|
21218
|
+
}
|
21219
|
+
],
|
21220
|
+
"return_types": [
|
21221
|
+
|
21222
|
+
]
|
21223
|
+
},
|
21224
|
+
{
|
21225
|
+
"name": "with_leading_visual_icons",
|
21226
|
+
"description": "Adds a pair of leading visual icon rendered to the left of the node's label.",
|
21227
|
+
"parameters": [
|
21228
|
+
{
|
21229
|
+
"name": "label",
|
21230
|
+
"type": "String",
|
21231
|
+
"default": "`nil`",
|
21232
|
+
"description": "A label describing the visual, displayed only to screen readers."
|
21233
|
+
},
|
21234
|
+
{
|
21235
|
+
"name": "system_arguments",
|
21236
|
+
"type": "Hash",
|
21237
|
+
"default": "N/A",
|
21238
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::IconPair{{/link_to_component}}."
|
21239
|
+
}
|
21240
|
+
],
|
21241
|
+
"return_types": [
|
21242
|
+
|
21243
|
+
]
|
21244
|
+
},
|
21245
|
+
{
|
21246
|
+
"name": "with_leading_action_button",
|
21247
|
+
"description": "Adds a leading action rendered to the left of the node's label and any leading visuals or checkboxes.",
|
21248
|
+
"parameters": [
|
21249
|
+
{
|
21250
|
+
"name": "system_arguments",
|
21251
|
+
"type": "Hash",
|
21252
|
+
"default": "N/A",
|
21253
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::Beta::IconButton{{/link_to_component}}."
|
21254
|
+
}
|
21255
|
+
],
|
21256
|
+
"return_types": [
|
21257
|
+
|
21258
|
+
]
|
21259
|
+
},
|
21260
|
+
{
|
21261
|
+
"name": "with_trailing_visual_icon",
|
21262
|
+
"description": "Adds a trailing visual icon rendered to the right of the node's label.",
|
21263
|
+
"parameters": [
|
21264
|
+
{
|
21265
|
+
"name": "label",
|
21266
|
+
"type": "String",
|
21267
|
+
"default": "`nil`",
|
21268
|
+
"description": "A label describing the visual, displayed only to screen readers."
|
21269
|
+
},
|
21270
|
+
{
|
21271
|
+
"name": "system_arguments",
|
21272
|
+
"type": "Hash",
|
21273
|
+
"default": "N/A",
|
21274
|
+
"description": "The arguments accepted by {{#link_to_component}}Primer::OpenProject::TreeView::Icon{{/link_to_component}}."
|
21275
|
+
}
|
21276
|
+
],
|
21277
|
+
"return_types": [
|
21278
|
+
|
21279
|
+
]
|
21280
|
+
}
|
21281
|
+
],
|
21282
|
+
"previews": [
|
21283
|
+
|
21284
|
+
],
|
21285
|
+
"subcomponents": [
|
21286
|
+
|
21287
|
+
]
|
21288
|
+
},
|
21289
|
+
{
|
21290
|
+
"fully_qualified_name": "Primer::OpenProject::TreeView::Visual",
|
21291
|
+
"description": "A `TreeView` visual, either leading or trailing.\n\nThis component is part of the {{#link_to_component}}Primer::OpenProject::TreeView{{/link_to_component}} component and should\nnot be used directly.",
|
21292
|
+
"accessibility_docs": null,
|
21293
|
+
"is_form_component": false,
|
21294
|
+
"is_published": true,
|
21295
|
+
"requires_js": false,
|
21296
|
+
"component": "OpenProject::TreeView::Visual",
|
21297
|
+
"status": "alpha",
|
21298
|
+
"a11y_reviewed": false,
|
21299
|
+
"short_name": "OpenProjectTreeViewVisual",
|
21300
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/tree_view/visual.rb",
|
21301
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/tree_view/visual/default/",
|
21302
|
+
"parameters": [
|
21303
|
+
{
|
21304
|
+
"name": "id",
|
21305
|
+
"type": "String",
|
21306
|
+
"default": "N/A",
|
21307
|
+
"description": "This visual's HTML ID."
|
21308
|
+
},
|
21309
|
+
{
|
21310
|
+
"name": "visual",
|
21311
|
+
"type": "ViewComponent::Base",
|
21312
|
+
"default": "N/A",
|
21313
|
+
"description": "A renderable component like an instance of {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}} to render as the visual."
|
21314
|
+
},
|
21315
|
+
{
|
21316
|
+
"name": "label",
|
21317
|
+
"type": "String",
|
21318
|
+
"default": "`nil`",
|
21319
|
+
"description": "Text describing this visual that will be visible only to screen readers."
|
21320
|
+
}
|
21321
|
+
],
|
21322
|
+
"slots": [
|
21323
|
+
|
21324
|
+
],
|
21325
|
+
"methods": [
|
21326
|
+
|
21327
|
+
],
|
21328
|
+
"previews": [
|
21329
|
+
|
21330
|
+
],
|
21331
|
+
"subcomponents": [
|
21332
|
+
|
21333
|
+
]
|
21334
|
+
},
|
19956
21335
|
{
|
19957
21336
|
"fully_qualified_name": "Primer::OpenProject::ZenModeButton",
|
19958
21337
|
"description": "Add a general description of component here\nAdd additional usage considerations or best practices that may aid the user to use the component correctly.",
|