Skip to content

Commit

Permalink
[nested-v-grid] Support sticky row-header-labels
Browse files Browse the repository at this point in the history
  • Loading branch information
kimo-k committed Jan 24, 2025
1 parent e657d98 commit 429c3cb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
24 changes: 22 additions & 2 deletions run/resources/public/assets/css/re-com.css
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,6 @@ code {
}

.rc-nested-v-grid-row-header-grid > div:not(.rc-nested-v-grid-resizer) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
user-select: none;
Expand All @@ -1575,8 +1574,18 @@ code {
border-right: thin solid #aaa;;
}

.rc-nested-v-grid-column-header-grid > div:not(.rc-nested-v-grid-resizer) {
.rc-nested-v-grid-row-header-grid > div:not(.rc-nested-v-grid-resizer) > div {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
user-select: none;
font-size: 13px;
background-color: #eee;
color: #777;
text-align: left;
}

.rc-nested-v-grid-column-header-grid > div:not(.rc-nested-v-grid-resizer) {
text-overflow: ellipsis;
white-space: nowrap;
user-select: none;
Expand All @@ -1592,6 +1601,17 @@ code {
border-bottom: thin solid #aaa;
}

.rc-nested-v-grid-column-header-grid > div:not(.rc-nested-v-grid-resizer) > div {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
user-select: none;
font-size: 13px;
background-color: #eee;
color: #777;
text-align: center;
}

.rc-nested-v-grid-corner-header-grid > div:not(.rc-nested-v-grid-resizer) {
overflow: hidden;
text-overflow: ellipsis;
Expand Down
12 changes: 8 additions & 4 deletions src/re_com/nested_v_grid.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -327,18 +327,23 @@
end-path (some #(when (= (count %) path-ct) %) ;;TODO make this more efficient.
(drop (inc i) @row-paths))
{:keys [branch-end?]} (meta row-path)
row-path-prop (cond-> row-path hide-root? (subvec 1))]
row-path-prop (cond-> row-path hide-root? (subvec 1))
cross-size (get @internal-row-header-widths (dec path-ct) row-header-width)]
:let [props {:part ::row-header
:row-path row-path-prop
:path row-path-prop
:keypath (get @row-keypaths i)
:branch-end? branch-end?
:style {:grid-row-start (ngu/path->grid-line-name row-path)
:cross-size cross-size
:grid-row-end (ngu/path->grid-line-name end-path)
:grid-column-start (cond-> (count row-path) branch-end? dec)
:grid-column-end -1}}
props (assoc props :children [(u/part row-header-label
{:props props
{:props (assoc props
:style {:width (- cross-size 10)
:position :sticky
:top @column-header-height-total})
:impl ngp/row-header-label})])]]
(u/part row-header
{:part ::row-header
Expand All @@ -363,8 +368,7 @@
:style {:grid-column-start (ngu/path->grid-line-name column-path)
:grid-column-end (ngu/path->grid-line-name end-path)
:grid-row-start (cond-> (count column-path) branch-end? dec)
:grid-row-end -1
:overflow :hidden}}
:grid-row-end -1}}
props (assoc props :children [(u/part column-header-label
{:props props
:impl ngp/column-header-label})])]]
Expand Down

0 comments on commit 429c3cb

Please sign in to comment.