simple-table-core 4.0.8 → 4.1.0

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 (38) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/styles.css +1 -1
  3. package/dist/core/SimpleTableVanilla.d.ts +7 -6
  4. package/dist/icons/MinusIcon.d.ts +2 -0
  5. package/dist/icons/index.d.ts +1 -0
  6. package/dist/index.d.ts +3 -2
  7. package/dist/index.es.js +1 -1
  8. package/dist/styles.css +1 -1
  9. package/dist/types/CellChangeProps.d.ts +5 -4
  10. package/dist/types/CellClickProps.d.ts +5 -4
  11. package/dist/types/CellRendererProps.d.ts +6 -5
  12. package/dist/types/ColumnDef.d.ts +53 -32
  13. package/dist/types/FilterTypes.d.ts +7 -5
  14. package/dist/types/GenerateRowIdParams.d.ts +4 -3
  15. package/dist/types/GetRowId.d.ts +4 -3
  16. package/dist/types/HeaderRendererProps.d.ts +6 -4
  17. package/dist/types/OnRowGroupExpandProps.d.ts +4 -3
  18. package/dist/types/PivotTypes.d.ts +11 -7
  19. package/dist/types/QuickFilterTypes.d.ts +5 -4
  20. package/dist/types/Row.d.ts +6 -0
  21. package/dist/types/RowButton.d.ts +4 -3
  22. package/dist/types/RowSelectionChangeProps.d.ts +3 -2
  23. package/dist/types/RowStateRendererProps.d.ts +13 -12
  24. package/dist/types/SimpleTableConfig.d.ts +28 -22
  25. package/dist/types/SimpleTableProps.d.ts +28 -22
  26. package/dist/types/TableAPI.d.ts +24 -19
  27. package/dist/types/TableRow.d.ts +5 -4
  28. package/dist/types/UpdateCellProps.d.ts +5 -3
  29. package/dist/utils/columnEditor/columnEditorUtils.d.ts +3 -0
  30. package/dist/utils/columnEditor/createCheckbox.d.ts +7 -2
  31. package/dist/utils/normalizeConfig.d.ts +4 -1
  32. package/package.json +1 -1
  33. package/src/styles/base.css +64 -35
  34. package/src/styles/themes/dark.css +9 -0
  35. package/src/styles/themes/light.css +9 -0
  36. package/src/styles/themes/modern-dark.css +9 -0
  37. package/src/styles/themes/modern-light.css +9 -0
  38. package/src/styles/themes/neutral.css +9 -0
@@ -270,6 +270,7 @@ input {
270
270
  .st-header-pinned-right {
271
271
  overflow-x: auto;
272
272
  overflow-y: hidden;
273
+ background-color: var(--st-header-background-color);
273
274
  }
274
275
 
275
276
  .st-header-main::-webkit-scrollbar {
@@ -521,7 +522,8 @@ input {
521
522
  background-color: var(--st-header-highlight-indicator-color);
522
523
  }
523
524
 
524
- /* Common styles for table header and cells */
525
+ /* Common layout for header and body cells. Background stays on `.st-header-cell`
526
+ / `.st-cell` separately — a shared transparent bg would override the header. */
525
527
  .st-header-cell,
526
528
  .st-cell {
527
529
  position: relative;
@@ -530,7 +532,9 @@ input {
530
532
  color: var(--st-cell-color);
531
533
  gap: var(--st-spacing-small);
532
534
  overflow: hidden;
533
- /* mix-blend-mode: multiply; */
535
+ }
536
+
537
+ .st-cell {
534
538
  background-color: transparent;
535
539
  }
536
540
 
@@ -711,8 +715,8 @@ input {
711
715
  display: flex;
712
716
  align-items: center;
713
717
  justify-content: center;
714
- margin-left: 4px;
715
- border-radius: 4px;
718
+ margin-left: var(--st-spacing-small);
719
+ border-radius: var(--st-border-radius);
716
720
  align-self: stretch;
717
721
  transition: outline 0.2s ease;
718
722
  }
@@ -1359,6 +1363,7 @@ input {
1359
1363
  .st-expand-icon[fill="none"] path,
1360
1364
  .st-next-prev-icon[fill="none"] path,
1361
1365
  .st-checkbox-checkmark[fill="none"] path,
1366
+ .st-checkbox-minus[fill="none"] path,
1362
1367
  .st-custom-select-arrow[fill="none"] path {
1363
1368
  fill: none;
1364
1369
  }
@@ -1446,13 +1451,15 @@ input {
1446
1451
  border-color var(--st-transition-duration) var(--st-transition-ease);
1447
1452
  }
1448
1453
 
1449
- .st-checkbox-custom.st-checked {
1454
+ .st-checkbox-custom.st-checked,
1455
+ .st-checkbox-custom.st-indeterminate {
1450
1456
  background-color: var(--st-checkbox-checked-background-color);
1451
1457
  border-color: var(--st-checkbox-checked-border-color);
1452
1458
  }
1453
1459
 
1454
- .st-checkbox-checkmark {
1455
- color: white;
1460
+ .st-checkbox-checkmark,
1461
+ .st-checkbox-minus {
1462
+ color: var(--st-button-active-text-color);
1456
1463
  }
1457
1464
 
1458
1465
  @keyframes slide-in-left {
@@ -1665,6 +1672,12 @@ input {
1665
1672
  cursor: default;
1666
1673
  }
1667
1674
 
1675
+ /* Date pickers are taller than the default dropdown cap (day grid + footer).
1676
+ Keep max-height for enum/option lists; let calendars size to content. */
1677
+ .st-dropdown-content:has(> .st-datepicker) {
1678
+ max-height: none;
1679
+ }
1680
+
1668
1681
  /* Filter popover (and similar): nested .st-dropdown-content menus must not be clipped by the shell.
1669
1682
  overflow:auto + max-height on the parent creates a scrollport that clips absolutely positioned
1670
1683
  children (operator CustomSelect, date picker, etc.). */
@@ -1688,12 +1701,12 @@ input {
1688
1701
 
1689
1702
  /* Dropdown items */
1690
1703
  .st-dropdown-item {
1691
- padding: var(--st-spacing-small) var(--st-spacing-medium);
1704
+ padding: var(--st-control-padding-y) var(--st-control-padding-x);
1692
1705
  cursor: pointer;
1693
1706
  white-space: nowrap;
1694
1707
  transition: background-color var(--st-transition-duration) var(--st-transition-ease);
1695
1708
  color: var(--st-cell-color);
1696
- font-size: 0.9em;
1709
+ font-size: var(--st-overlay-font-size);
1697
1710
  }
1698
1711
 
1699
1712
  .st-dropdown-item:hover {
@@ -1716,13 +1729,15 @@ input {
1716
1729
  .st-datepicker {
1717
1730
  background-color: var(--st-odd-row-background-color);
1718
1731
  font-family: inherit;
1732
+ font-size: var(--st-overlay-font-size);
1719
1733
  }
1720
1734
 
1721
1735
  .st-datepicker-header {
1722
1736
  display: flex;
1723
1737
  justify-content: space-between;
1724
1738
  align-items: center;
1725
- padding: var(--st-spacing-medium);
1739
+ /* Match footer: light vertical pad around square nav buttons */
1740
+ padding: 6px var(--st-overlay-padding);
1726
1741
  border-bottom: 1px solid var(--st-border-color);
1727
1742
  background-color: var(--st-header-background-color);
1728
1743
  }
@@ -1730,11 +1745,16 @@ input {
1730
1745
  .st-datepicker-header-label {
1731
1746
  color: var(--st-header-label-color);
1732
1747
  font-weight: 600;
1733
- cursor: pointer;
1748
+ font-size: var(--st-overlay-font-size);
1749
+ cursor: default;
1734
1750
  text-align: center;
1735
1751
  flex: 1;
1736
1752
  }
1737
1753
 
1754
+ .st-datepicker-header-label[role="button"] {
1755
+ cursor: pointer;
1756
+ }
1757
+
1738
1758
  .st-datepicker-nav-btn {
1739
1759
  background: transparent;
1740
1760
  display: flex;
@@ -1744,7 +1764,10 @@ input {
1744
1764
  cursor: pointer;
1745
1765
  font-size: 1.2em;
1746
1766
  color: var(--st-cell-color);
1747
- padding: 0 8px;
1767
+ width: var(--st-datepicker-day-size);
1768
+ height: var(--st-datepicker-day-size);
1769
+ padding: 0;
1770
+ flex-shrink: 0;
1748
1771
  border-radius: var(--st-border-radius);
1749
1772
  }
1750
1773
  .st-datepicker-nav-btn > * {
@@ -1760,7 +1783,7 @@ input {
1760
1783
 
1761
1784
  .st-datepicker-grid {
1762
1785
  display: grid;
1763
- padding: var(--st-spacing-medium);
1786
+ padding: var(--st-overlay-padding);
1764
1787
  }
1765
1788
 
1766
1789
  .st-datepicker-days-grid {
@@ -1780,7 +1803,7 @@ input {
1780
1803
 
1781
1804
  .st-datepicker-weekday {
1782
1805
  text-align: center;
1783
- font-size: 0.8em;
1806
+ font-size: 12px;
1784
1807
  font-weight: 600;
1785
1808
  padding: 6px 0;
1786
1809
  color: var(--st-datepicker-weekday-color);
@@ -1791,12 +1814,12 @@ input {
1791
1814
  display: flex;
1792
1815
  align-items: center;
1793
1816
  justify-content: center;
1794
- height: 24px;
1795
- width: 24px;
1817
+ height: var(--st-datepicker-day-size);
1818
+ width: var(--st-datepicker-day-size);
1796
1819
  border-radius: 50%;
1797
1820
  cursor: pointer;
1798
1821
  transition: background-color var(--st-transition-duration) var(--st-transition-ease);
1799
- font-size: 0.9em;
1822
+ font-size: var(--st-overlay-font-size);
1800
1823
  }
1801
1824
 
1802
1825
  .st-datepicker-day.empty {
@@ -1846,7 +1869,9 @@ input {
1846
1869
  .st-datepicker-footer {
1847
1870
  display: flex;
1848
1871
  justify-content: flex-end;
1849
- padding: var(--st-spacing-medium);
1872
+ align-items: center;
1873
+ /* Same vertical rhythm as header — Today shouldn't sit in a tall band */
1874
+ padding: 6px var(--st-overlay-padding);
1850
1875
  border-top: 1px solid var(--st-border-color);
1851
1876
  }
1852
1877
 
@@ -1854,10 +1879,13 @@ input {
1854
1879
  background-color: transparent;
1855
1880
  border: 1px solid var(--st-border-color);
1856
1881
  border-radius: var(--st-border-radius);
1857
- padding: 6px 12px;
1882
+ padding: var(--st-spacing-small) var(--st-control-padding-x);
1883
+ min-height: var(--st-datepicker-day-size);
1884
+ box-sizing: border-box;
1858
1885
  cursor: pointer;
1859
1886
  transition: background-color var(--st-transition-duration) var(--st-transition-ease);
1860
1887
  color: var(--st-cell-color);
1888
+ font-size: var(--st-overlay-font-size);
1861
1889
  }
1862
1890
 
1863
1891
  .st-datepicker-today-btn:hover {
@@ -1869,8 +1897,9 @@ input {
1869
1897
  display: flex;
1870
1898
  flex-direction: column;
1871
1899
  flex-grow: 1;
1872
- padding: var(--st-spacing-medium);
1873
- min-width: 150px;
1900
+ padding: var(--st-overlay-padding);
1901
+ min-width: 200px;
1902
+ font-size: var(--st-overlay-font-size);
1874
1903
  }
1875
1904
 
1876
1905
  /* Filter Section - Used for spacing between form sections */
@@ -1884,10 +1913,10 @@ input {
1884
1913
  /* Filter Input - Text and number inputs */
1885
1914
  .st-filter-input {
1886
1915
  width: 100%;
1887
- padding: var(--st-spacing-small);
1916
+ padding: var(--st-control-padding-y) var(--st-control-padding-x);
1888
1917
  border: var(--st-border-width) solid var(--st-border-color);
1889
1918
  border-radius: var(--st-border-radius);
1890
- font-size: 0.9em;
1919
+ font-size: var(--st-overlay-font-size);
1891
1920
  background-color: var(--st-odd-row-background-color);
1892
1921
  color: var(--st-cell-color);
1893
1922
  font-family: inherit;
@@ -1907,10 +1936,10 @@ input {
1907
1936
  /* Filter Select - Dropdown selectors */
1908
1937
  .st-filter-select {
1909
1938
  width: 100%;
1910
- padding: var(--st-spacing-medium) var(--st-spacing-medium);
1939
+ padding: var(--st-control-padding-y) var(--st-control-padding-x);
1911
1940
  border: var(--st-border-width) solid var(--st-border-color);
1912
1941
  border-radius: var(--st-border-radius);
1913
- font-size: 0.9em;
1942
+ font-size: var(--st-overlay-font-size);
1914
1943
  background-color: var(--st-odd-row-background-color);
1915
1944
  color: var(--st-cell-color);
1916
1945
  font-family: inherit;
@@ -1933,11 +1962,11 @@ input {
1933
1962
 
1934
1963
  .st-filter-button {
1935
1964
  flex: 1;
1936
- padding: var(--st-spacing-small);
1965
+ padding: var(--st-control-padding-y) var(--st-control-padding-x);
1937
1966
  border: none;
1938
1967
  border-radius: var(--st-border-radius);
1939
1968
  cursor: pointer;
1940
- font-size: 0.9em;
1969
+ font-size: var(--st-overlay-font-size);
1941
1970
  font-weight: 500;
1942
1971
  font-family: inherit;
1943
1972
  appearance: none;
@@ -1957,7 +1986,7 @@ input {
1957
1986
  /* Apply Button */
1958
1987
  .st-filter-button-apply {
1959
1988
  background-color: var(--st-button-active-background-color);
1960
- color: white;
1989
+ color: var(--st-button-active-text-color);
1961
1990
  }
1962
1991
 
1963
1992
  .st-filter-button-apply:hover:not(.st-filter-button-disabled) {
@@ -1990,13 +2019,13 @@ input {
1990
2019
 
1991
2020
  .st-custom-select-trigger {
1992
2021
  width: 100%;
1993
- padding: var(--st-spacing-small);
2022
+ padding: var(--st-control-padding-y) var(--st-control-padding-x);
1994
2023
  border: var(--st-border-width) solid var(--st-border-color);
1995
2024
  border-radius: var(--st-border-radius);
1996
2025
  background-color: var(--st-odd-row-background-color);
1997
2026
  color: var(--st-cell-color);
1998
2027
  font-family: inherit;
1999
- font-size: 0.9em;
2028
+ font-size: var(--st-overlay-font-size);
2000
2029
  cursor: pointer;
2001
2030
  display: flex;
2002
2031
  align-items: center;
@@ -2052,14 +2081,14 @@ input {
2052
2081
 
2053
2082
  .st-custom-select-option {
2054
2083
  flex-shrink: 0;
2055
- padding: var(--st-spacing-small);
2084
+ padding: var(--st-control-padding-y) var(--st-control-padding-x);
2056
2085
  cursor: pointer;
2057
2086
  transition: background-color var(--st-transition-duration) var(--st-transition-ease);
2058
2087
  white-space: nowrap;
2059
2088
  overflow: hidden;
2060
2089
  text-overflow: ellipsis;
2061
2090
  color: var(--st-cell-color);
2062
- font-size: 0.9em;
2091
+ font-size: var(--st-overlay-font-size);
2063
2092
  }
2064
2093
 
2065
2094
  .st-custom-select-option:hover,
@@ -2128,7 +2157,7 @@ input {
2128
2157
 
2129
2158
  /* Enum option label */
2130
2159
  .st-enum-option-label {
2131
- font-size: 0.9em;
2160
+ font-size: var(--st-overlay-font-size);
2132
2161
  color: var(--st-cell-color);
2133
2162
  user-select: none;
2134
2163
  }
@@ -2144,8 +2173,8 @@ input {
2144
2173
  .st-enum-no-results {
2145
2174
  padding: var(--st-spacing-medium);
2146
2175
  text-align: center;
2147
- font-size: 0.9em;
2148
- color: var(--st-slate-400);
2176
+ font-size: var(--st-overlay-font-size);
2177
+ color: var(--st-muted-text-color);
2149
2178
  font-style: italic;
2150
2179
  }
2151
2180
 
@@ -8,6 +8,13 @@
8
8
  --st-spacing-small: 4px;
9
9
  --st-spacing-medium: 8px;
10
10
 
11
+ /* Overlay / filter control sizing (aligned with table type + cell padding) */
12
+ --st-overlay-font-size: 14px;
13
+ --st-overlay-padding: 8px;
14
+ --st-control-padding-y: 6px;
15
+ --st-control-padding-x: 8px;
16
+ --st-datepicker-day-size: 28px;
17
+
11
18
  /* Scrollbar variables */
12
19
  --st-scrollbar-bg-color: var(--st-gray-900);
13
20
  --st-scrollbar-thumb-color: var(--st-gray-600);
@@ -65,6 +72,7 @@
65
72
  /* Button colors */
66
73
  --st-button-hover-background-color: var(--st-gray-600);
67
74
  --st-button-active-background-color: var(--st-blue-500);
75
+ --st-button-active-text-color: var(--st-white);
68
76
  --st-next-prev-btn-color: var(--st-gray-300);
69
77
  --st-next-prev-btn-disabled-color: var(--st-gray-600);
70
78
  --st-page-btn-color: var(--st-gray-300);
@@ -86,6 +94,7 @@
86
94
  --st-datepicker-other-month-color: var(--st-gray-600);
87
95
  --st-filter-button-disabled-background-color: var(--st-gray-700);
88
96
  --st-filter-button-disabled-text-color: var(--st-gray-500);
97
+ --st-muted-text-color: var(--st-gray-400);
89
98
 
90
99
  /* Flash/Animation colors */
91
100
  --st-cell-flash-color: var(--st-gray-600);
@@ -8,6 +8,13 @@
8
8
  --st-spacing-small: 4px;
9
9
  --st-spacing-medium: 8px;
10
10
 
11
+ /* Overlay / filter control sizing (aligned with table type + cell padding) */
12
+ --st-overlay-font-size: 14px;
13
+ --st-overlay-padding: 8px;
14
+ --st-control-padding-y: 6px;
15
+ --st-control-padding-x: 8px;
16
+ --st-datepicker-day-size: 28px;
17
+
11
18
  /* Scrollbar variables */
12
19
  --st-scrollbar-bg-color: var(--st-slate-50);
13
20
  --st-scrollbar-thumb-color: var(--st-slate-300);
@@ -65,6 +72,7 @@
65
72
  /* Button colors */
66
73
  --st-button-hover-background-color: var(--st-slate-100);
67
74
  --st-button-active-background-color: var(--st-blue-600);
75
+ --st-button-active-text-color: var(--st-white);
68
76
  --st-next-prev-btn-color: var(--st-slate-600);
69
77
  --st-next-prev-btn-disabled-color: var(--st-slate-400);
70
78
  --st-page-btn-color: var(--st-slate-600);
@@ -85,6 +93,7 @@
85
93
  --st-datepicker-other-month-color: var(--st-slate-400);
86
94
  --st-filter-button-disabled-background-color: var(--st-slate-300);
87
95
  --st-filter-button-disabled-text-color: var(--st-slate-500);
96
+ --st-muted-text-color: var(--st-slate-500);
88
97
 
89
98
  /* Flash/Animation colors */
90
99
  --st-cell-flash-color: var(--st-slate-200);
@@ -24,6 +24,13 @@
24
24
  --st-spacing-small: 4px;
25
25
  --st-spacing-medium: 8px;
26
26
 
27
+ /* Overlay / filter control sizing (tracks roomier modern cell padding) */
28
+ --st-overlay-font-size: 14px;
29
+ --st-overlay-padding: 12px;
30
+ --st-control-padding-y: 8px;
31
+ --st-control-padding-x: 12px;
32
+ --st-datepicker-day-size: 32px;
33
+
27
34
  /* Scrollbar variables - Dark minimal */
28
35
  --st-scrollbar-bg-color: #111827;
29
36
  --st-scrollbar-thumb-color: #4b5563;
@@ -80,6 +87,7 @@
80
87
  /* Button colors - Clean, minimal dark */
81
88
  --st-button-hover-background-color: #374151;
82
89
  --st-button-active-background-color: #3b82f6;
90
+ --st-button-active-text-color: var(--st-white);
83
91
  --st-next-prev-btn-color: #9ca3af;
84
92
  --st-next-prev-btn-disabled-color: #4b5563;
85
93
  --st-page-btn-color: #d1d5db;
@@ -101,6 +109,7 @@
101
109
  --st-datepicker-other-month-color: #4b5563;
102
110
  --st-filter-button-disabled-background-color: #374151;
103
111
  --st-filter-button-disabled-text-color: #6b7280;
112
+ --st-muted-text-color: #9ca3af;
104
113
 
105
114
  /* Flash/Animation colors */
106
115
  --st-cell-flash-color: #1e40af;
@@ -27,6 +27,13 @@
27
27
  --st-spacing-small: 4px;
28
28
  --st-spacing-medium: 8px;
29
29
 
30
+ /* Overlay / filter control sizing (tracks roomier modern cell padding) */
31
+ --st-overlay-font-size: 14px;
32
+ --st-overlay-padding: 12px;
33
+ --st-control-padding-y: 8px;
34
+ --st-control-padding-x: 12px;
35
+ --st-datepicker-day-size: 32px;
36
+
30
37
  /* Scrollbar variables - Minimal */
31
38
  --st-scrollbar-bg-color: #fafafa;
32
39
  --st-scrollbar-thumb-color: #d1d5db;
@@ -83,6 +90,7 @@
83
90
  /* Button colors - Clean, minimal */
84
91
  --st-button-hover-background-color: #f3f4f6;
85
92
  --st-button-active-background-color: #3b82f6;
93
+ --st-button-active-text-color: var(--st-white);
86
94
  --st-next-prev-btn-color: #6b7280;
87
95
  --st-next-prev-btn-disabled-color: #d1d5db;
88
96
  --st-page-btn-color: #374151;
@@ -103,6 +111,7 @@
103
111
  --st-datepicker-other-month-color: #d1d5db;
104
112
  --st-filter-button-disabled-background-color: #f3f4f6;
105
113
  --st-filter-button-disabled-text-color: #9ca3af;
114
+ --st-muted-text-color: #6b7280;
106
115
 
107
116
  /* Flash/Animation colors */
108
117
  --st-cell-flash-color: #dbeafe;
@@ -8,6 +8,13 @@
8
8
  --st-spacing-small: 4px;
9
9
  --st-spacing-medium: 8px;
10
10
 
11
+ /* Overlay / filter control sizing (aligned with table type + cell padding) */
12
+ --st-overlay-font-size: 14px;
13
+ --st-overlay-padding: 8px;
14
+ --st-control-padding-y: 6px;
15
+ --st-control-padding-x: 8px;
16
+ --st-datepicker-day-size: 28px;
17
+
11
18
  /* Scrollbar variables */
12
19
  --st-scrollbar-bg-color: var(--st-neutral-100);
13
20
  --st-scrollbar-thumb-color: var(--st-neutral-400);
@@ -66,6 +73,7 @@
66
73
  /* Button colors */
67
74
  --st-button-hover-background-color: var(--st-neutral-200);
68
75
  --st-button-active-background-color: var(--st-neutral-600);
76
+ --st-button-active-text-color: var(--st-white);
69
77
  --st-next-prev-btn-color: var(--st-neutral-600);
70
78
  --st-next-prev-btn-disabled-color: var(--st-neutral-400);
71
79
  --st-page-btn-color: var(--st-neutral-600);
@@ -86,6 +94,7 @@
86
94
  --st-datepicker-other-month-color: var(--st-neutral-400);
87
95
  --st-filter-button-disabled-background-color: var(--st-neutral-300);
88
96
  --st-filter-button-disabled-text-color: var(--st-neutral-500);
97
+ --st-muted-text-color: var(--st-neutral-500);
89
98
 
90
99
  /* Flash/Animation colors */
91
100
  --st-cell-flash-color: var(--st-neutral-400);