@redvars/peacock 4.3.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@redvars/peacock",
3
3
  "description": "The foundation for beautiful user interfaces",
4
4
  "license": "Apache-2.0",
5
- "version": "4.3.0",
5
+ "version": "4.3.1",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.js",
@@ -16,7 +16,11 @@
16
16
 
17
17
  .body {
18
18
  position: relative;
19
- padding-inline-start: var(--_connector-width);
19
+
20
+ // The connector column shows only once there are two items to join.
21
+ &.connected {
22
+ padding-inline-start: var(--_connector-width);
23
+ }
20
24
  }
21
25
 
22
26
  .connector {
@@ -487,7 +487,7 @@ export class CbGroupBase extends LitElement {
487
487
  @dragleave=${this._onDragLeave}
488
488
  @drop=${this._onDrop}
489
489
  >
490
- <div class="body">
490
+ <div class=${classMap({ body: true, connected: this._itemCount > 1 })}>
491
491
  ${this._renderConnector()}
492
492
  <div class=${classMap({ items: true, empty: this._itemCount === 0 })}>
493
493
  <slot @slotchange=${this._onSlotChange}></slot>
@@ -17,5 +17,9 @@
17
17
  align-items: center;
18
18
  gap: var(--spacing-100);
19
19
  padding-top: var(--spacing-100);
20
+ }
21
+
22
+ // Lines up with the items while the connector column shows.
23
+ .body.connected + .footer {
20
24
  padding-inline-start: var(--_connector-width);
21
25
  }
@@ -48,10 +48,27 @@
48
48
  // Wide rows scroll inside the table instead of widening the page around it.
49
49
  contain: inline-size;
50
50
  position: relative;
51
+ display: flex;
52
+ flex-direction: column;
51
53
  flex: 1 1 auto;
52
54
  min-height: 0;
53
55
  overflow: auto;
54
56
  outline: none;
57
+
58
+ > * {
59
+ flex: none;
60
+ }
61
+
62
+ // The body takes the spare height, which its filler row passes on to the pinned edges.
63
+ > .body {
64
+ display: flex;
65
+ flex: 1 0 auto;
66
+ flex-direction: column;
67
+
68
+ > * {
69
+ flex: none;
70
+ }
71
+ }
55
72
  }
56
73
 
57
74
  // ── Rows and cells ──────────────────────────────────────────────────────────
@@ -506,7 +523,13 @@
506
523
  .loading-bar {
507
524
  position: absolute;
508
525
  inset-inline: 0;
509
- bottom: 0;
526
+ // The progress track has a block margin of `--spacing-100`; offset it so the track lies on
527
+ // the header's bottom divider instead of floating above it.
528
+ bottom: calc(-1 * var(--spacing-100, 0.5rem));
529
+ // Above the pinned column groups, so it runs the full width of the table.
530
+ z-index: 2;
531
+ min-width: 0;
532
+ pointer-events: none;
510
533
  --progress-height: 2px;
511
534
  }
512
535
 
@@ -548,10 +571,37 @@
548
571
  }
549
572
 
550
573
  // The footer's top border already closes the table, so the last row needs no divider.
551
- .has-footer .body .row:last-child .cell {
574
+ .has-footer .body .row:last-child .cell,
575
+ .has-footer .body .row:has(+ .filler-row) .cell {
552
576
  border-bottom-color: transparent;
553
577
  }
554
578
 
579
+ // ── Filler row: the free height below the last row in a taller table ──────
580
+
581
+ .body .row.filler-row {
582
+ // Grows from zero: it shows only when the rows leave height free.
583
+ flex: 1 0 0;
584
+ min-block-size: 0;
585
+ pointer-events: none;
586
+
587
+ > .columns {
588
+ align-self: stretch;
589
+ }
590
+ }
591
+
592
+ // With a footer the last row drops its divider; the filler draws it while it has height.
593
+ .has-footer .body .row.filler-row {
594
+ background: linear-gradient(
595
+ var(--table-border-color),
596
+ var(--table-border-color)
597
+ )
598
+ top / 100% 1px no-repeat;
599
+ }
600
+
601
+ .filler-cell {
602
+ flex-shrink: 0;
603
+ }
604
+
555
605
  :host([striped]) .body .row:nth-child(even):not(.selected) {
556
606
  --_cell-background: color-mix(
557
607
  in srgb,
@@ -1804,11 +1804,7 @@ export class Table extends LitElement {
1804
1804
  this.onSortActivate(column, event.shiftKey)}
1805
1805
  >
1806
1806
  ${renderHeaderLabel(column)}
1807
- <wc-icon
1808
- class="sort-icon"
1809
- aria-hidden="true"
1810
- name=${icon}
1811
- ></wc-icon>
1807
+ <wc-icon class="sort-icon" aria-hidden="true" name=${icon}></wc-icon>
1812
1808
  ${showPriority
1813
1809
  ? html`<span class="sort-priority" aria-hidden="true"
1814
1810
  >${position + 1}</span
@@ -2246,7 +2242,25 @@ export class Table extends LitElement {
2246
2242
 
2247
2243
  private renderBody(columns: GridColumn[], view: TableView) {
2248
2244
  return html`<div class="body" role="rowgroup">
2249
- ${this.renderBodyRows(columns, view)}
2245
+ ${this.renderBodyRows(columns, view)}${this.renderFillerRow(columns)}
2246
+ </div>`;
2247
+ }
2248
+
2249
+ /**
2250
+ * Takes the height the rows leave free in a taller table, so the pinned column edges
2251
+ * run down to the footer instead of stopping at the last row. Not part of the grid.
2252
+ */
2253
+ private renderFillerRow(columns: GridColumn[]) {
2254
+ return html`<div
2255
+ class="row filler-row"
2256
+ aria-hidden="true"
2257
+ style="--_row-min-width: ${totalWidth(columns)}rem"
2258
+ >
2259
+ ${renderRowGroups(
2260
+ columns,
2261
+ entry =>
2262
+ html`<div class="filler-cell" style=${cellStyle(entry)}></div>`,
2263
+ )}
2250
2264
  </div>`;
2251
2265
  }
2252
2266