Skip to content

Commit

Permalink
[nested-v-grid] Add :resize-row-height? prop
Browse files Browse the repository at this point in the history
  • Loading branch information
kimo-k committed Jan 22, 2025
1 parent e81e636 commit 966c3f3
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/re_com/nested_v_grid.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,12 @@
row-header-label column-header-label
row-header-grid column-header-grid
corner-header-grid cell-grid
resize-row-height?
row-height column-width]} :parts
:as props
:or
{hide-root? true
resize-row-height? true
on-resize (fn [{:keys [header-dimension size-dimension keypath size]}]
(case [header-dimension size-dimension]
[:column :height] (swap! internal-column-header-heights assoc-in keypath size)
Expand Down Expand Up @@ -433,7 +435,8 @@
:props {:children (cond-> cells
(not @hide-resizers?)
(concat
(row-height-resizers {:offset -1})
(when resize-row-height?
(row-height-resizers {:offset -1}))
(column-width-resizers {:style {:grid-row-end -1}
:offset -1})))
:style {:grid-template-rows @row-template
Expand All @@ -443,23 +446,27 @@
:part ::column-header-grid
:props {:children (cond-> column-headers
(not @hide-resizers?)
(concat column-height-resizers (column-width-resizers {:offset -1})))
(concat column-height-resizers
(column-width-resizers {:offset -1})))
:style {:grid-template-rows @column-cross-template
:grid-template-columns @column-template}}})
(u/part row-header-grid
{:theme theme
:part ::row-header-grid
:props {:children (cond-> row-headers
(not @hide-resizers?)
(concat row-width-resizers (row-height-resizers {:offset -1})))
(concat row-width-resizers
(when resize-row-height?
(row-height-resizers {:offset -1}))))
:style {:grid-template-rows @row-template
:grid-template-columns @row-cross-template}}})
(u/part corner-header-grid
{:theme theme
:part ::corner-header-grid
:props {:children (cond-> corner-headers
(not @hide-resizers?)
(concat row-width-resizers column-height-resizers))
(concat row-width-resizers
column-height-resizers))
:style {:grid-template-rows @column-cross-template
:grid-template-columns @row-cross-template}}})
(u/deref-or-value overlay)]}})))})))

0 comments on commit 966c3f3

Please sign in to comment.