Skip to content

Commit a468873

Browse files
committed
[dropdown] [tree-select] Add :body-footer prop
For day8/rf8.day8.com.au#132
1 parent 9cab7b6 commit a468873

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

Diff for: src/re_com/dropdown.cljs

+14-8
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,16 @@
4444
{:name :body-wrapper
4545
:impl "[box]"
4646
:level 1
47-
:notes "Wraps the :body and :body-header parts. Provides intelligent positioning."}
47+
:notes "Shown when the dropdown is open. Provides intelligent positioning."}
4848
{:name :body-header
4949
:impl "user-defined"
50-
:level 2
51-
:notes "Shown when the dropdown is open."}
50+
:level 2}
51+
{:name :body-header
52+
:impl "user-defined"
53+
:level 2}
5254
{:name :body
5355
:impl "user-defined"
54-
:level 2
55-
:notes "Shown when the dropdown is open."}]))
56+
:level 2}]))
5657

5758
(def dropdown-parts
5859
(when include-args-desc?
@@ -112,6 +113,10 @@
112113
:type "part"
113114
:validate-fn part?
114115
:description (str "Appears at the top of the :body part.")}
116+
{:name :body-footer
117+
:type "part"
118+
:validate-fn part?
119+
:description (str "Appears at the bottom of the :body part.")}
115120
{:name :disabled?
116121
:required false
117122
:type "boolean | r/atom"}
@@ -288,7 +293,7 @@
288293
anchor-height anchor-width
289294
model
290295
label placeholder
291-
anchor backdrop body body-header indicator
296+
anchor backdrop body body-header body-footer indicator
292297
parts theme main-theme theme-vars base-theme
293298
width]
294299
:or {placeholder "Select an item"
@@ -365,8 +370,9 @@
365370
:parts parts
366371
:state state
367372
:theme theme}
368-
[u/part body-header part-props nil]
369-
[u/part body part-props]])]})])))))
373+
[u/part body-header part-props]
374+
[u/part body part-props]
375+
[u/part body-footer part-props]])]})])))))
370376

371377
(defn- move-to-new-choice
372378
"In a vector of maps (where each map has an :id), return the id of the choice offset posititions away

Diff for: src/re_com/tree_select.cljs

+2-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@
534534
label-fn alt-text-fn group-label-fn model placeholder id-fn field-label-fn
535535
groups-first? initial-expanded-groups
536536
show-reset-button? on-reset
537-
label body-header choice
537+
label body-header body-footer choice
538538
empty-means-full?
539539
parts theme main-theme theme-vars base-theme]
540540
:or {placeholder "Select an item..."
@@ -586,6 +586,7 @@
586586
(deref-or-value expanded-groups))))}])]})])
587587
:width width
588588
:body-header body-header
589+
:body-footer body-footer
589590
:body [tree-select
590591
(themed ::dropdown-body
591592
{:choices choices

0 commit comments

Comments
 (0)