Skip to content

Commit 429c3cb

Browse files
committed
[nested-v-grid] Support sticky row-header-labels
1 parent e657d98 commit 429c3cb

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

run/resources/public/assets/css/re-com.css

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,6 @@ code {
15591559
}
15601560

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

1578-
.rc-nested-v-grid-column-header-grid > div:not(.rc-nested-v-grid-resizer) {
1577+
.rc-nested-v-grid-row-header-grid > div:not(.rc-nested-v-grid-resizer) > div {
15791578
overflow: hidden;
1579+
text-overflow: ellipsis;
1580+
white-space: nowrap;
1581+
user-select: none;
1582+
font-size: 13px;
1583+
background-color: #eee;
1584+
color: #777;
1585+
text-align: left;
1586+
}
1587+
1588+
.rc-nested-v-grid-column-header-grid > div:not(.rc-nested-v-grid-resizer) {
15801589
text-overflow: ellipsis;
15811590
white-space: nowrap;
15821591
user-select: none;
@@ -1592,6 +1601,17 @@ code {
15921601
border-bottom: thin solid #aaa;
15931602
}
15941603

1604+
.rc-nested-v-grid-column-header-grid > div:not(.rc-nested-v-grid-resizer) > div {
1605+
overflow: hidden;
1606+
text-overflow: ellipsis;
1607+
white-space: nowrap;
1608+
user-select: none;
1609+
font-size: 13px;
1610+
background-color: #eee;
1611+
color: #777;
1612+
text-align: center;
1613+
}
1614+
15951615
.rc-nested-v-grid-corner-header-grid > div:not(.rc-nested-v-grid-resizer) {
15961616
overflow: hidden;
15971617
text-overflow: ellipsis;

src/re_com/nested_v_grid.cljs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,18 +327,23 @@
327327
end-path (some #(when (= (count %) path-ct) %) ;;TODO make this more efficient.
328328
(drop (inc i) @row-paths))
329329
{:keys [branch-end?]} (meta row-path)
330-
row-path-prop (cond-> row-path hide-root? (subvec 1))]
330+
row-path-prop (cond-> row-path hide-root? (subvec 1))
331+
cross-size (get @internal-row-header-widths (dec path-ct) row-header-width)]
331332
:let [props {:part ::row-header
332333
:row-path row-path-prop
333334
:path row-path-prop
334335
:keypath (get @row-keypaths i)
335336
:branch-end? branch-end?
336337
:style {:grid-row-start (ngu/path->grid-line-name row-path)
338+
:cross-size cross-size
337339
:grid-row-end (ngu/path->grid-line-name end-path)
338340
:grid-column-start (cond-> (count row-path) branch-end? dec)
339341
:grid-column-end -1}}
340342
props (assoc props :children [(u/part row-header-label
341-
{:props props
343+
{:props (assoc props
344+
:style {:width (- cross-size 10)
345+
:position :sticky
346+
:top @column-header-height-total})
342347
:impl ngp/row-header-label})])]]
343348
(u/part row-header
344349
{:part ::row-header
@@ -363,8 +368,7 @@
363368
:style {:grid-column-start (ngu/path->grid-line-name column-path)
364369
:grid-column-end (ngu/path->grid-line-name end-path)
365370
:grid-row-start (cond-> (count column-path) branch-end? dec)
366-
:grid-row-end -1
367-
:overflow :hidden}}
371+
:grid-row-end -1}}
368372
props (assoc props :children [(u/part column-header-label
369373
{:props props
370374
:impl ngp/column-header-label})])]]

0 commit comments

Comments
 (0)