simple-table-core 3.4.1 → 3.5.2

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.
Files changed (44) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/src/core/SimpleTableVanilla.d.ts +55 -0
  3. package/dist/cjs/src/core/rendering/RenderOrchestrator.d.ts +9 -0
  4. package/dist/cjs/src/core/rendering/TableRenderer.d.ts +4 -1
  5. package/dist/cjs/src/managers/AnimationCoordinator.d.ts +64 -0
  6. package/dist/cjs/src/types/TableRow.d.ts +6 -5
  7. package/dist/cjs/src/utils/accordionAnimation.d.ts +25 -0
  8. package/dist/cjs/src/utils/bodyCell/styling.d.ts +7 -0
  9. package/dist/cjs/src/utils/bodyCell/types.d.ts +11 -0
  10. package/dist/cjs/src/utils/headerCell/types.d.ts +18 -0
  11. package/dist/cjs/src/utils/rowUtils.d.ts +21 -2
  12. package/dist/cjs/src/utils/stickyParentsRenderer.d.ts +14 -0
  13. package/dist/cjs/stories/examples/BasicRowGrouping.d.ts +4 -0
  14. package/dist/cjs/stories/examples/CollapsibleColumnsExample.d.ts +4 -0
  15. package/dist/cjs/stories/examples/DynamicNestedTableExample.d.ts +2 -0
  16. package/dist/cjs/stories/examples/pinned-columns/PinnedColumns.d.ts +2 -0
  17. package/dist/cjs/stories/tests/17-NestedTablesTests.stories.d.ts +64 -6
  18. package/dist/cjs/stories/tests/43-CollapseExpandAnimationsTests.stories.d.ts +63 -0
  19. package/dist/cjs/stories/tests/testUtils.d.ts +5 -0
  20. package/dist/cjs/styles.css +1 -1
  21. package/dist/index.es.js +1 -1
  22. package/dist/src/core/SimpleTableVanilla.d.ts +55 -0
  23. package/dist/src/core/rendering/RenderOrchestrator.d.ts +9 -0
  24. package/dist/src/core/rendering/TableRenderer.d.ts +4 -1
  25. package/dist/src/managers/AnimationCoordinator.d.ts +64 -0
  26. package/dist/src/types/TableRow.d.ts +6 -5
  27. package/dist/src/utils/accordionAnimation.d.ts +25 -0
  28. package/dist/src/utils/bodyCell/styling.d.ts +7 -0
  29. package/dist/src/utils/bodyCell/types.d.ts +11 -0
  30. package/dist/src/utils/headerCell/types.d.ts +18 -0
  31. package/dist/src/utils/rowUtils.d.ts +21 -2
  32. package/dist/src/utils/stickyParentsRenderer.d.ts +14 -0
  33. package/dist/stories/examples/BasicRowGrouping.d.ts +4 -0
  34. package/dist/stories/examples/CollapsibleColumnsExample.d.ts +4 -0
  35. package/dist/stories/examples/DynamicNestedTableExample.d.ts +2 -0
  36. package/dist/stories/examples/pinned-columns/PinnedColumns.d.ts +2 -0
  37. package/dist/stories/tests/17-NestedTablesTests.stories.d.ts +64 -6
  38. package/dist/stories/tests/43-CollapseExpandAnimationsTests.stories.d.ts +63 -0
  39. package/dist/stories/tests/testUtils.d.ts +5 -0
  40. package/dist/styles.css +1 -1
  41. package/package.json +1 -1
  42. package/src/styles/base.css +99 -48
  43. package/src/styles/themes/modern-light.css +12 -12
  44. package/src/styles/themes/theme-custom.css +2 -2
@@ -193,6 +193,8 @@ input {
193
193
  .st-header-container.st-header-scroll-padding::after {
194
194
  content: "";
195
195
  display: block;
196
+ /* `*` does not target ::after; border-box keeps the bottom border inside the flex line. */
197
+ box-sizing: border-box;
196
198
  width: var(--st-after-width, default-width);
197
199
  flex-shrink: 0;
198
200
  background-color: var(--st-header-background-color);
@@ -282,14 +284,12 @@ input {
282
284
  left: 0;
283
285
  display: flex;
284
286
  z-index: 10;
285
- pointer-events: none;
286
287
  }
287
288
 
288
289
  .st-sticky-section-left,
289
290
  .st-sticky-section-main,
290
291
  .st-sticky-section-right {
291
292
  overflow: hidden;
292
- pointer-events: none;
293
293
  }
294
294
 
295
295
  .st-sticky-section-left {
@@ -369,9 +369,9 @@ input {
369
369
  }
370
370
  .st-row.hovered .st-cell-editing,
371
371
  .st-row.hovered
372
- .st-cell:not(.st-cell-selected):not(.st-cell-selected-first):not(
373
- .st-cell-column-selected
374
- ):not(.st-cell-column-selected-first) {
372
+ .st-cell:not(.st-cell-selected):not(.st-cell-selected-first):not(.st-cell-column-selected):not(
373
+ .st-cell-column-selected-first
374
+ ) {
375
375
  background-color: var(--st-hover-row-background-color);
376
376
  }
377
377
  /* Separate hover background for sub-cells */
@@ -396,9 +396,9 @@ input {
396
396
  /* Selected row hover state - should override selected background when hovering */
397
397
  .st-row.selected.hovered .st-cell-editing,
398
398
  .st-row.selected.hovered
399
- .st-cell:not(.st-cell-selected):not(.st-cell-selected-first):not(
400
- .st-cell-column-selected
401
- ):not(.st-cell-column-selected-first) {
399
+ .st-cell:not(.st-cell-selected):not(.st-cell-selected-first):not(.st-cell-column-selected):not(
400
+ .st-cell-column-selected-first
401
+ ) {
402
402
  background-color: var(--st-hover-row-background-color);
403
403
  }
404
404
 
@@ -601,8 +601,7 @@ input {
601
601
  .st-resizeable .st-body-pinned-right .st-cell-content,
602
602
  .st-resizeable .st-sticky-section-right .st-cell-content {
603
603
  padding-left: calc(
604
- var(--st-cell-padding) + var(--st-spacing-small) +
605
- var(--st-resize-handle-container-width)
604
+ var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-container-width)
606
605
  );
607
606
  padding-right: var(--st-cell-padding);
608
607
  }
@@ -614,8 +613,7 @@ input {
614
613
  .st-resizeable .st-sticky-section-main .st-cell-content {
615
614
  padding-left: var(--st-cell-padding);
616
615
  padding-right: calc(
617
- var(--st-cell-padding) + var(--st-spacing-small) +
618
- var(--st-resize-handle-container-width)
616
+ var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-container-width)
619
617
  );
620
618
  }
621
619
 
@@ -858,7 +856,12 @@ input {
858
856
  display: flex;
859
857
  align-items: center;
860
858
  border-top: var(--st-border-width) solid var(--st-border-color);
861
- height: 12px;
859
+ /* Container content area = height - border-top.
860
+ Visible bar thickness = host / scrollbar height (below).
861
+ Padding above + below the bar = content area - bar thickness, split
862
+ evenly by align-items: center. Currently: 13 - 1 = 12px content,
863
+ 8px bar -> 2px padding top + 2px padding bottom. */
864
+ height: 13px;
862
865
  width: 100%;
863
866
  background-color: var(--st-scrollbar-bg-color);
864
867
  }
@@ -874,12 +877,28 @@ input {
874
877
  border-left: var(--st-border-width) solid var(--st-border-color);
875
878
  }
876
879
  .st-horizontal-scrollbar-left,
877
- .st-horizontal-scrollbar-right {
878
- height: 100%;
880
+ .st-horizontal-scrollbar-right,
881
+ .st-horizontal-scrollbar-middle {
882
+ height: 8px;
883
+ /* Suppress vertical scrolling on these elements. The inner sentinel <div>
884
+ is 0.3px tall purely to give the host a horizontal scrollWidth wider
885
+ than its clientWidth (so the horizontal scrollbar appears). When the
886
+ host has no spare vertical content area (e.g. host height ==
887
+ scrollbar height), that 0.3px sentinel triggers a phantom vertical
888
+ scrollbar reservation, which eats into clientWidth and desyncs the
889
+ horizontal thumb's drag math from the actual scrollable range. Forcing
890
+ overflow-y: hidden removes that possibility entirely. */
891
+ overflow-x: auto;
892
+ overflow-y: hidden;
893
+ /* `scrollbar-color` is inherited from `.simple-table-root`. When set to a
894
+ non-`auto` value, Chromium switches the element to standard CSS
895
+ scrollbar mode and ignores the `::-webkit-scrollbar` pseudo rules
896
+ below. Resetting to `auto` re-enables the WebKit pseudo styling so
897
+ the scrollbar is rendered at exactly the height we specify. */
898
+ scrollbar-color: auto;
879
899
  }
880
900
  .st-horizontal-scrollbar-middle {
881
901
  flex-grow: 1;
882
- min-height: 11px;
883
902
  }
884
903
  .st-horizontal-scrollbar-left > div,
885
904
  .st-horizontal-scrollbar-right > div,
@@ -887,6 +906,16 @@ input {
887
906
  height: 0.3px;
888
907
  }
889
908
 
909
+ /* Match the host height exactly: bar fills the host with no internal gap,
910
+ and the host is centered inside the container's content area, producing
911
+ the symmetric top/bottom padding around the bar. Keep this in sync with
912
+ the host height above. */
913
+ .st-horizontal-scrollbar-left::-webkit-scrollbar,
914
+ .st-horizontal-scrollbar-right::-webkit-scrollbar,
915
+ .st-horizontal-scrollbar-middle::-webkit-scrollbar {
916
+ height: 8px;
917
+ }
918
+
890
919
  .st-footer {
891
920
  display: flex;
892
921
  justify-content: space-between;
@@ -926,8 +955,7 @@ input {
926
955
  background-color: transparent;
927
956
  border: none;
928
957
  border-radius: var(--st-border-radius);
929
- transition: background-color var(--st-transition-duration)
930
- var(--st-transition-ease);
958
+ transition: background-color var(--st-transition-duration) var(--st-transition-ease);
931
959
  }
932
960
  .st-next-prev-btn {
933
961
  fill: var(--st-next-prev-btn-color);
@@ -954,8 +982,7 @@ input {
954
982
  color: var(--st-page-btn-color);
955
983
  border: none;
956
984
  border-radius: var(--st-border-radius);
957
- transition: background-color var(--st-transition-duration)
958
- var(--st-transition-ease);
985
+ transition: background-color var(--st-transition-duration) var(--st-transition-ease);
959
986
  display: inline-flex;
960
987
  align-items: center;
961
988
  justify-content: center;
@@ -1004,8 +1031,7 @@ input {
1004
1031
  font-size: 0.875rem;
1005
1032
  }
1006
1033
  .editable-cell-input:focus {
1007
- border: var(--st-border-width) solid
1008
- var(--st-editable-cell-focus-border-color);
1034
+ border: var(--st-border-width) solid var(--st-editable-cell-focus-border-color);
1009
1035
  }
1010
1036
  .st-column-editor {
1011
1037
  display: flex;
@@ -1375,8 +1401,7 @@ input {
1375
1401
  border-bottom: var(--st-border-width) solid var(--st-border-color);
1376
1402
  color: var(--st-cell-color);
1377
1403
  font-weight: var(--st-font-weight-bold);
1378
- transition: background-color var(--st-transition-duration)
1379
- var(--st-transition-ease);
1404
+ transition: background-color var(--st-transition-duration) var(--st-transition-ease);
1380
1405
  }
1381
1406
 
1382
1407
  .st-group-header:hover {
@@ -1436,6 +1461,41 @@ input {
1436
1461
  pointer-events: none;
1437
1462
  }
1438
1463
 
1464
+ /*
1465
+ * Accordion animation window for nested-column and row-grouping collapse/expand.
1466
+ *
1467
+ * Active for one collapse/expand operation: SimpleTableVanilla adds the
1468
+ * `st-accordion-animating` class plus inline `--st-accordion-duration` /
1469
+ * `--st-accordion-easing` custom properties on the table root, then removes
1470
+ * them once the animation ends.
1471
+ *
1472
+ * The transition applies to `width`/`height` only — `transform` is driven by
1473
+ * the FLIP `AnimationCoordinator` with its own inline transition string, and
1474
+ * transitioning `top`/`left` here would race with that. `overflow: hidden` is
1475
+ * needed so cell content is clipped while the cell shrinks/grows from zero
1476
+ * size in the active axis.
1477
+ */
1478
+ .st-accordion-animating .st-cell,
1479
+ .st-accordion-animating .st-header-cell {
1480
+ transition:
1481
+ width var(--st-accordion-duration, var(--st-transition-duration))
1482
+ var(--st-accordion-easing, var(--st-transition-ease)),
1483
+ height var(--st-accordion-duration, var(--st-transition-duration))
1484
+ var(--st-accordion-easing, var(--st-transition-ease));
1485
+ overflow: hidden;
1486
+ }
1487
+
1488
+ /*
1489
+ * Nested grid rows position themselves with `transform: translate3d(0, Ypx, 0)`
1490
+ * (not `style.top`), so the FLIP-style cell coordinator doesn't drive them.
1491
+ * SectionRenderer applies an inline transition on transform/height when it
1492
+ * updates an existing nested-grid-row in place (because an unrelated row
1493
+ * above expanded/collapsed, or a sibling's child data resolved and changed
1494
+ * total layout height) — that lets the inline-style update interpolate
1495
+ * instead of snapping. Initial creation deliberately writes the transform
1496
+ * without a transition so the row appears at its destination immediately.
1497
+ */
1498
+
1439
1499
  /* Cell update animation */
1440
1500
  @keyframes cell-flash {
1441
1501
  0% {
@@ -1548,8 +1608,7 @@ input {
1548
1608
  padding: var(--st-spacing-small) var(--st-spacing-medium);
1549
1609
  cursor: pointer;
1550
1610
  white-space: nowrap;
1551
- transition: background-color var(--st-transition-duration)
1552
- var(--st-transition-ease);
1611
+ transition: background-color var(--st-transition-duration) var(--st-transition-ease);
1553
1612
  color: var(--st-cell-color);
1554
1613
  font-size: 0.9em;
1555
1614
  }
@@ -1650,8 +1709,7 @@ input {
1650
1709
  width: 24px;
1651
1710
  border-radius: 50%;
1652
1711
  cursor: pointer;
1653
- transition: background-color var(--st-transition-duration)
1654
- var(--st-transition-ease);
1712
+ transition: background-color var(--st-transition-duration) var(--st-transition-ease);
1655
1713
  font-size: 0.9em;
1656
1714
  }
1657
1715
 
@@ -1685,8 +1743,7 @@ input {
1685
1743
  padding: 12px 8px;
1686
1744
  border-radius: var(--st-border-radius);
1687
1745
  cursor: pointer;
1688
- transition: background-color var(--st-transition-duration)
1689
- var(--st-transition-ease);
1746
+ transition: background-color var(--st-transition-duration) var(--st-transition-ease);
1690
1747
  }
1691
1748
 
1692
1749
  .st-datepicker-month:hover,
@@ -1713,8 +1770,7 @@ input {
1713
1770
  border-radius: var(--st-border-radius);
1714
1771
  padding: 6px 12px;
1715
1772
  cursor: pointer;
1716
- transition: background-color var(--st-transition-duration)
1717
- var(--st-transition-ease);
1773
+ transition: background-color var(--st-transition-duration) var(--st-transition-ease);
1718
1774
  color: var(--st-cell-color);
1719
1775
  }
1720
1776
 
@@ -1750,8 +1806,7 @@ input {
1750
1806
  color: var(--st-cell-color);
1751
1807
  font-family: inherit;
1752
1808
  outline: none;
1753
- transition: border-color var(--st-transition-duration)
1754
- var(--st-transition-ease);
1809
+ transition: border-color var(--st-transition-duration) var(--st-transition-ease);
1755
1810
  }
1756
1811
 
1757
1812
  .st-filter-input:focus {
@@ -1775,8 +1830,7 @@ input {
1775
1830
  font-family: inherit;
1776
1831
  cursor: pointer;
1777
1832
  outline: none;
1778
- transition: border-color var(--st-transition-duration)
1779
- var(--st-transition-ease);
1833
+ transition: border-color var(--st-transition-duration) var(--st-transition-ease);
1780
1834
  }
1781
1835
 
1782
1836
  .st-filter-select:focus {
@@ -1802,8 +1856,7 @@ input {
1802
1856
  font-family: inherit;
1803
1857
  appearance: none;
1804
1858
  -webkit-appearance: none;
1805
- transition: background-color var(--st-transition-duration)
1806
- var(--st-transition-ease);
1859
+ transition: background-color var(--st-transition-duration) var(--st-transition-ease);
1807
1860
  }
1808
1861
  /* Keyboard only — avoids a stuck ring after mouse click (especially on bordered Clear) */
1809
1862
  .st-filter-button:focus {
@@ -1867,8 +1920,7 @@ input {
1867
1920
  appearance: none;
1868
1921
  -webkit-appearance: none;
1869
1922
  text-align: left;
1870
- transition: border-color var(--st-transition-duration)
1871
- var(--st-transition-ease);
1923
+ transition: border-color var(--st-transition-duration) var(--st-transition-ease);
1872
1924
  }
1873
1925
 
1874
1926
  .st-custom-select-trigger:focus {
@@ -1916,8 +1968,7 @@ input {
1916
1968
  flex-shrink: 0;
1917
1969
  padding: var(--st-spacing-small);
1918
1970
  cursor: pointer;
1919
- transition: background-color var(--st-transition-duration)
1920
- var(--st-transition-ease);
1971
+ transition: background-color var(--st-transition-duration) var(--st-transition-ease);
1921
1972
  white-space: nowrap;
1922
1973
  overflow: hidden;
1923
1974
  text-overflow: ellipsis;
@@ -2062,18 +2113,18 @@ input {
2062
2113
  /* Maintain column borders on hover */
2063
2114
  .st-column-borders
2064
2115
  .st-row.hovered
2065
- .st-cell:not(.st-last-column):not(.st-cell-selected):not(
2066
- .st-cell-selected-first
2067
- ):not(.st-cell-column-selected):not(.st-cell-column-selected-first) {
2116
+ .st-cell:not(.st-last-column):not(.st-cell-selected):not(.st-cell-selected-first):not(
2117
+ .st-cell-column-selected
2118
+ ):not(.st-cell-column-selected-first) {
2068
2119
  box-shadow: var(--st-border-width) 0 0 0 var(--st-border-color);
2069
2120
  }
2070
2121
 
2071
2122
  /* Maintain column borders on selected row hover */
2072
2123
  .st-column-borders
2073
2124
  .st-row.selected.hovered
2074
- .st-cell:not(.st-last-column):not(.st-cell-selected):not(
2075
- .st-cell-selected-first
2076
- ):not(.st-cell-column-selected):not(.st-cell-column-selected-first) {
2125
+ .st-cell:not(.st-last-column):not(.st-cell-selected):not(.st-cell-selected-first):not(
2126
+ .st-cell-column-selected
2127
+ ):not(.st-cell-column-selected-first) {
2077
2128
  box-shadow: var(--st-border-width) 0 0 0 var(--st-border-color);
2078
2129
  }
2079
2130
 
@@ -1,7 +1,7 @@
1
1
  /* Modern Light Theme - Clean, minimal design inspired by contemporary table UIs
2
2
  *
3
3
  * Design Philosophy:
4
- * - Subtle borders (#f3f4f6) for a clean, uncluttered look
4
+ * - Light gray borders (#e5e7eb) for structure without heavy chrome
5
5
  * - White backgrounds with minimal color variation
6
6
  * - Hover states instead of alternating row colors
7
7
  * - Generous padding (12px) for better readability
@@ -26,8 +26,8 @@
26
26
  --st-scrollbar-thumb-color: #d1d5db;
27
27
  --st-scrollbar-width: thin;
28
28
 
29
- /* Base/Structural colors - Very subtle borders */
30
- --st-border-color: #f3f4f6;
29
+ /* Base/Structural colors - Visible but still light (gray-200) */
30
+ --st-border-color: #e5e7eb;
31
31
  --st-footer-background-color: var(--st-white);
32
32
  --st-last-group-row-separator-border-color: #e5e7eb;
33
33
 
@@ -132,30 +132,30 @@
132
132
 
133
133
  /* Modern Light theme specific overrides for even cleaner look */
134
134
  .theme-modern-light .st-wrapper {
135
- border: 1px solid #f3f4f6;
135
+ border: 1px solid var(--st-border-color);
136
136
  }
137
137
 
138
138
  /* Subtle header border */
139
139
  .theme-modern-light .st-header-pinned-left,
140
140
  .theme-modern-light .st-header-main,
141
141
  .theme-modern-light .st-header-pinned-right {
142
- border-bottom: 1px solid #f3f4f6;
142
+ border-bottom: 1px solid var(--st-border-color);
143
143
  }
144
144
 
145
145
  /* Remove heavy borders on pinned sections */
146
146
  .theme-modern-light .st-header-pinned-left,
147
147
  .theme-modern-light .st-body-pinned-left {
148
- border-right: 1px solid #f3f4f6;
148
+ border-right: 1px solid var(--st-border-color);
149
149
  }
150
150
 
151
151
  .theme-modern-light .st-header-pinned-right,
152
152
  .theme-modern-light .st-body-pinned-right {
153
- border-left: 1px solid #f3f4f6;
153
+ border-left: 1px solid var(--st-border-color);
154
154
  }
155
155
 
156
- /* Cleaner row separators */
156
+ /* Row separators — match grid lines for readable horizontal breaks */
157
157
  .theme-modern-light .st-row-separator {
158
- background-color: #f9fafb;
158
+ background-color: var(--st-border-color);
159
159
  }
160
160
 
161
161
  /* Lighter header cell styling */
@@ -178,7 +178,7 @@
178
178
 
179
179
  /* Modern footer styling */
180
180
  .theme-modern-light .st-footer {
181
- border-top: 1px solid #f3f4f6;
181
+ border-top: 1px solid var(--st-border-color);
182
182
  background-color: var(--st-white);
183
183
  padding: 12px 16px;
184
184
  gap: 12px;
@@ -242,13 +242,13 @@
242
242
 
243
243
  /* Modern scrollbar */
244
244
  .theme-modern-light .st-horizontal-scrollbar-container {
245
- border-top: 1px solid #f3f4f6;
245
+ border-top: 1px solid var(--st-border-color);
246
246
  background-color: #fafafa;
247
247
  }
248
248
 
249
249
  /* Cleaner group headers */
250
250
  .theme-modern-light .st-group-header {
251
- border-bottom: 1px solid #f3f4f6;
251
+ border-bottom: 1px solid var(--st-border-color);
252
252
  font-weight: 500;
253
253
  }
254
254
 
@@ -16,8 +16,8 @@
16
16
  --st-scrollbar-thumb-color: #d1d5db;
17
17
  --st-scrollbar-width: thin;
18
18
 
19
- /* Base/Structural colors - Very subtle borders */
20
- --st-border-color: #f3f4f6;
19
+ /* Base/Structural colors - aligned with modern-light (gray-200) */
20
+ --st-border-color: #e5e7eb;
21
21
  --st-footer-background-color: var(--st-white);
22
22
  --st-last-group-row-separator-border-color: #e5e7eb;
23
23