|
229 | 229 | row-header-grid column-header-grid
|
230 | 230 | corner-header-grid cell-grid
|
231 | 231 | resize-row-height?
|
| 232 | + resize-column-header-height? |
232 | 233 | row-height column-width]} :parts
|
233 | 234 | :as props
|
234 | 235 | :or
|
235 |
| - {hide-root? true |
236 |
| - resize-row-height? true |
237 |
| - on-resize (fn [{:keys [header-dimension size-dimension keypath size]}] |
238 |
| - (case [header-dimension size-dimension] |
239 |
| - [:column :height] (swap! internal-column-header-heights assoc-in keypath size) |
240 |
| - [:row :width] (swap! internal-row-header-widths assoc-in keypath size) |
241 |
| - [:row :height] (swap! internal-row-tree update-in keypath assoc :size size) |
242 |
| - [:column :width] (swap! internal-column-tree update-in keypath assoc :size size)))}}] |
| 236 | + {hide-root? true |
| 237 | + resize-row-height? true |
| 238 | + resize-column-header-height? true |
| 239 | + on-resize (fn [{:keys [header-dimension size-dimension keypath size]}] |
| 240 | + (case [header-dimension size-dimension] |
| 241 | + [:column :height] (swap! internal-column-header-heights assoc-in keypath size) |
| 242 | + [:row :width] (swap! internal-row-header-widths assoc-in keypath size) |
| 243 | + [:row :height] (swap! internal-row-tree update-in keypath assoc :size size) |
| 244 | + [:column :width] (swap! internal-column-tree update-in keypath assoc :size size)))}}] |
243 | 245 | (let [ensure-reactivity u/deref-or-value
|
244 | 246 | external-keys [:row-tree :row-header-widths :row-height
|
245 | 247 | :column-tree :column-header-heights :column-width
|
|
446 | 448 | :part ::column-header-grid
|
447 | 449 | :props {:children (cond-> column-headers
|
448 | 450 | (not @hide-resizers?)
|
449 |
| - (concat column-height-resizers |
| 451 | + (concat (when resize-column-header-height? |
| 452 | + column-height-resizers) |
450 | 453 | (column-width-resizers {:offset -1})))
|
451 | 454 | :style {:grid-template-rows @column-cross-template
|
452 | 455 | :grid-template-columns @column-template}}})
|
|
466 | 469 | :props {:children (cond-> corner-headers
|
467 | 470 | (not @hide-resizers?)
|
468 | 471 | (concat row-width-resizers
|
469 |
| - column-height-resizers)) |
| 472 | + (when resize-column-header-height? |
| 473 | + column-height-resizers))) |
470 | 474 | :style {:grid-template-rows @column-cross-template
|
471 | 475 | :grid-template-columns @row-cross-template}}})
|
472 | 476 | (u/deref-or-value overlay)]}})))})))
|
0 commit comments