Skip to content

Commit

Permalink
[tree-select] Add custom parts-table title
Browse files Browse the repository at this point in the history
  • Loading branch information
kimo-k committed Jul 8, 2024
1 parent a468873 commit b0e1730
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/re_demo/tree_select.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -335,5 +335,5 @@
"includes an anchor label. By default, it lists all the selected choices, except if an entire group is selected, then that group appears in place of its descendants."]
[args-table tree-select-dropdown-args-desc]]]
[demo]]]
[parts-table "tree-select" tree-select-parts-desc]
[parts-table "tree-select-dropdown" tree-select-dropdown-parts-desc]]])
[parts-table "tree-select" tree-select-parts-desc :title [:span "Parts: " [:code "[:tree-select]"]]]
[parts-table "tree-select-dropdown" tree-select-dropdown-parts-desc :title [:span "Parts: " [:code "[:tree-select]"]]]]])
4 changes: 2 additions & 2 deletions src/re_demo/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@
:child [:span notes]]]])

(defn parts-table
[component-name parts]
[component-name parts & {:keys [title]}]
(let [name-of-first-part (str (first (remove nil? (map :name parts))))
code-example-spaces (reduce #(str % " ") "" (range (+ (count name-of-first-part) 13)))]
[v-box
:src (at)
:margin "0px 20px 20px 0px"
:children (concat
[[title2 "Parts"]
[[title2 (or title "Parts")]
[p "This component is constructed from a hierarchy of HTML elements which we refer to as \"parts\"."]
[p "re-com gives each of these parts a unique CSS class, so that you can individually target them.
Also, each part is identified by a keyword for use in " [:code ":parts"] " like this:" [:br]]
Expand Down

0 comments on commit b0e1730

Please sign in to comment.