@svelte-lean/table 0.15.0 → 0.15.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @svelte-lean/table
2
2
 
3
+ ## 0.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Pinned columns: the edge shade is one continuous gradient, and it shows only while content lies past that edge. It was a blurred `box-shadow` on every edge cell (`6px 0 8px -6px`), and a blur fades at each cell's top and bottom, so down a column of rows it read as a dashed line. The edge cell keeps its line; the shade is now a `::after` as tall as the cell, `--slean-table-pin-shadow-size` (8px) wide, a `linear-gradient` from `--slean-table-pin-shadow` to transparent (mirrored in RTL). The default ink is lighter: black at 6% (22% dark), from 10% (45%). Where scroll-state container queries are supported (the scroll region is now `container-type: scroll-state`), the start edge shades only while the region can scroll toward the start and the end edge only while it can scroll toward the end, so a table that fits draws no shade; elsewhere it always shows, as before. Behavior change: an edge cell's computed `box-shadow` is `none`; a theme that set `box-shadow` on `[data-pin-edge]` cells keeps its own. Tested in `apps/playground/tests/table/nested.spec.ts` (the shade is a gradient as tall as the cell, absent while the table fits, present once it is scrolled).
8
+
3
9
  ## 0.15.0
4
10
 
5
11
  No changes in this release.
package/dist/style.css CHANGED
@@ -79,7 +79,8 @@
79
79
  var(--slean-table-bg)
80
80
  );
81
81
  --slean-table-row-selected: var(--slean-table-selected);
82
- --slean-table-pin-shadow: light-dark(oklch(0% 0 0 / 0.1), oklch(0% 0 0 / 0.45));
82
+ --slean-table-pin-shadow: light-dark(oklch(0% 0 0 / 0.06), oklch(0% 0 0 / 0.22));
83
+ --slean-table-pin-shadow-size: 8px;
83
84
  --slean-table-row-lifted-shadow: var(
84
85
  --slean-elevation-3,
85
86
  0 4px 12px light-dark(oklch(0% 0 0 / 0.1), oklch(0% 0 0 / 0.5)),
@@ -266,6 +267,7 @@
266
267
  overflow: auto;
267
268
  position: relative;
268
269
  border-block: 1px solid var(--slean-table-border);
270
+ container-type: scroll-state;
269
271
  }
270
272
  /* Nothing above or below the scroll region (no toolbar, no pager): the root's border is the
271
273
  line, and the region clips its content to the root's rounded corners. */
@@ -639,19 +641,47 @@
639
641
  :where(thead .slean-table-mover, thead .slean-table-selection, thead .slean-table-expander) {
640
642
  z-index: 4;
641
643
  }
644
+ /* Pinned edges: a line and a shade as tall as the cell (a blurred shadow faded at each row's
645
+ ends, a dashed line); with scroll-state queries, only while content lies past the edge. */
642
646
  :where(.slean-table-scroll > table > * > tr > [data-pin='left'][data-pin-edge]) {
643
647
  border-inline-end: 1px solid var(--slean-table-border);
644
- box-shadow: 6px 0 8px -6px var(--slean-table-pin-shadow);
645
648
  }
646
649
  :where(.slean-table-scroll > table > * > tr > [data-pin='right'][data-pin-edge]) {
647
650
  border-inline-start: 1px solid var(--slean-table-border);
648
- box-shadow: -6px 0 8px -6px var(--slean-table-pin-shadow);
649
651
  }
650
- :where(.slean-table-scroll > table > * > tr > [data-pin='left'][data-pin-edge]:dir(rtl)) {
651
- box-shadow: -6px 0 8px -6px var(--slean-table-pin-shadow);
652
+ :where(.slean-table-scroll > table > * > tr > [data-pin-edge])::after {
653
+ content: '';
654
+ position: absolute;
655
+ inset-block: 0;
656
+ inset-inline-start: 100%;
657
+ inline-size: var(--slean-table-pin-shadow-size);
658
+ background: linear-gradient(to right, var(--slean-table-pin-shadow), transparent);
659
+ pointer-events: none;
660
+ }
661
+ :where(.slean-table-scroll > table > * > tr > [data-pin='right'][data-pin-edge])::after {
662
+ inset-inline: auto 100%;
663
+ scale: -1 1;
664
+ }
665
+ :where(.slean-table-scroll > table > * > tr > [data-pin-edge]:dir(rtl))::after {
666
+ scale: -1 1;
667
+ }
668
+ :where(.slean-table-scroll > table > * > tr > [data-pin='right'][data-pin-edge]:dir(rtl))::after {
669
+ scale: none;
652
670
  }
653
- :where(.slean-table-scroll > table > * > tr > [data-pin='right'][data-pin-edge]:dir(rtl)) {
654
- box-shadow: 6px 0 8px -6px var(--slean-table-pin-shadow);
671
+ @supports (container-type: scroll-state) {
672
+ :where(.slean-table-scroll > table > * > tr > [data-pin-edge])::after {
673
+ opacity: 0;
674
+ }
675
+ @container scroll-state(scrollable: inline-start) {
676
+ :where(.slean-table-scroll > table > * > tr > [data-pin='left'][data-pin-edge])::after {
677
+ opacity: 1;
678
+ }
679
+ }
680
+ @container scroll-state(scrollable: inline-end) {
681
+ :where(.slean-table-scroll > table > * > tr > [data-pin='right'][data-pin-edge])::after {
682
+ opacity: 1;
683
+ }
684
+ }
655
685
  }
656
686
  :where(.slean-table-scroll > table > tbody > tr > td[data-range='true']) {
657
687
  background: var(--slean-table-selected);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svelte-lean/table",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "A Svelte-native table and data-grid engine that ships only the features you use.",
5
5
  "license": "MIT",
6
6
  "author": "Ömer Say",