|
650 | 650 | path-ct (count column-path) |
651 | 651 | end-path (some #(when (= (count %) path-ct) %) |
652 | 652 | (drop (inc i) @column-paths)) |
653 | | - {:keys [branch-end?]} (meta column-path) |
| 653 | + {:keys [branch-end? branch? leaf?]} (meta column-path) |
654 | 654 | column-path-prop (cond-> column-path (not show-root-headers?) (subvec 1))] |
655 | 655 | #_#_:when (not branch-end?) |
656 | 656 | :let [props {:part ::column-header |
|
659 | 659 | :branch-end? branch-end? |
660 | 660 | :keypath (get @column-keypaths i) |
661 | 661 | :style {:grid-column-start (ngu/path->grid-line-name column-path) |
662 | | - :grid-column-end (ngu/path->grid-line-name end-path) |
| 662 | + :grid-column-end (cond |
| 663 | + end-path (ngu/path->grid-line-name end-path) |
| 664 | + leaf? "span 1" |
| 665 | + :else "-1") |
663 | 666 | :grid-row-start (cond-> (count column-path) |
664 | 667 | branch-end? dec |
665 | 668 | (not show-root-headers?) dec) |
|
705 | 708 | cells |
706 | 709 | (for [row-path @row-paths |
707 | 710 | column-path @column-paths |
708 | | - :when (and ((some-fn :leaf? :show?) (meta row-path)) |
709 | | - ((some-fn :leaf? :show?) (meta column-path))) |
710 | | - :let [props {:row-path (cond-> row-path show-root-headers? (subvec 1)) |
711 | | - :column-path (cond-> column-path show-root-headers? (subvec 1)) |
| 711 | + :let [row-meta (meta row-path) |
| 712 | + column-meta (meta column-path)] |
| 713 | + :when (and ((some-fn :leaf? :show?) row-meta) |
| 714 | + ((some-fn :leaf? :show?) column-meta)) |
| 715 | + :let [props {:row-path (cond-> row-path |
| 716 | + (not show-root-headers?) (subvec 1) |
| 717 | + (:branch-end? row-meta) pop) |
| 718 | + :column-path (cond-> column-path |
| 719 | + (not show-root-headers?) (subvec 1) |
| 720 | + (:branch-end? column-meta) pop) |
712 | 721 | :style {:grid-row-start (ngu/path->grid-line-name row-path) |
713 | 722 | :grid-column-start (ngu/path->grid-line-name column-path)}} |
714 | 723 | props (merge props |
|
724 | 733 | :after-props {:style style |
725 | 734 | :class class} |
726 | 735 | :props |
727 | | - {:style {:height 300 |
728 | | - :width 500 |
729 | | - :overflow :auto |
730 | | - :flex "0 0 auto" |
731 | | - :display :grid |
732 | | - :grid-template-rows (ngu/grid-cross-template [@column-header-height-total @row-height-total]) |
| 736 | + {:style {:grid-template-rows (ngu/grid-cross-template [@column-header-height-total @row-height-total]) |
733 | 737 | :grid-template-columns (ngu/grid-cross-template [@row-header-width-total @column-width-total])} |
734 | 738 | :attr {:ref wrapper-ref!} |
735 | 739 | :children |
|
0 commit comments