@smallwebco/tinypivot-react 1.0.24 → 1.0.25

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/dist/style.css CHANGED
@@ -414,19 +414,19 @@
414
414
  position: sticky;
415
415
  top: 0;
416
416
  z-index: 10;
417
- padding: 0.75rem 1rem;
417
+ padding: 0.5rem 0.75rem;
418
418
  text-align: left;
419
419
  cursor: pointer;
420
420
  -webkit-user-select: none;
421
421
  -moz-user-select: none;
422
422
  user-select: none;
423
- background: white;
423
+ background: #f8fafc;
424
424
  transition: all 0.15s;
425
425
  border-bottom: 1px solid #e2e8f0;
426
426
  border-right: 1px solid #f1f5f9;
427
427
  }
428
428
 
429
- .vpg-header-cell:hover { background: #f8fafc; }
429
+ .vpg-header-cell:hover { background: #f1f5f9; }
430
430
  .vpg-header-cell:last-child { border-right: none; }
431
431
  .vpg-header-cell.vpg-has-filter { background: #eef2ff; }
432
432
  .vpg-header-cell.vpg-is-sorted { background: #eff6ff; }
@@ -1073,6 +1073,7 @@
1073
1073
  .vpg-assigned-item.vpg-type-row { background: #eef2ff; border: 1px solid #c7d2fe; }
1074
1074
  .vpg-assigned-item.vpg-type-column { background: #f5f3ff; border: 1px solid #ddd6fe; }
1075
1075
  .vpg-assigned-item.vpg-type-value { background: #ecfdf5; border: 1px solid #a7f3d0; }
1076
+ .vpg-assigned-item.vpg-type-calc { background: #fdf4ff; border: 1px solid #f0abfc; cursor: pointer; }
1076
1077
 
1077
1078
  .vpg-item-main { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
1078
1079
 
@@ -1090,6 +1091,7 @@
1090
1091
  .vpg-item-badge.row { background: #c7d2fe; color: #4338ca; }
1091
1092
  .vpg-item-badge.column { background: #ddd6fe; color: #7c3aed; }
1092
1093
  .vpg-item-badge.value { background: #a7f3d0; color: #059669; }
1094
+ .vpg-item-badge.calc { background: #f0abfc; color: #86198f; }
1093
1095
 
1094
1096
  .vpg-item-name {
1095
1097
  overflow: hidden;
@@ -1237,6 +1239,30 @@
1237
1239
  .vpg-field-item:hover { border-color: #cbd5e1; background: #f8fafc; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
1238
1240
  .vpg-field-item:active { cursor: grabbing; transform: scale(0.98); }
1239
1241
  .vpg-field-item.vpg-is-numeric { border-color: #bfdbfe; background: rgba(239, 246, 255, 0.3); }
1242
+ .vpg-field-item.vpg-is-calculated { border-color: #e9d5ff; background: rgba(250, 232, 255, 0.5); }
1243
+
1244
+ .vpg-calc-type { background: #f0abfc !important; color: #86198f !important; }
1245
+
1246
+ .vpg-field-edit,
1247
+ .vpg-field-delete {
1248
+ width: 1.125rem;
1249
+ height: 1.125rem;
1250
+ display: flex;
1251
+ align-items: center;
1252
+ justify-content: center;
1253
+ font-size: 0.75rem;
1254
+ line-height: 1;
1255
+ color: #94a3b8;
1256
+ background: transparent;
1257
+ border: none;
1258
+ border-radius: 50%;
1259
+ cursor: pointer;
1260
+ transition: all 0.15s;
1261
+ flex-shrink: 0;
1262
+ }
1263
+
1264
+ .vpg-field-edit:hover { background: #e0e7ff; color: #4f46e5; }
1265
+ .vpg-field-delete:hover { background: #fee2e2; color: #ef4444; }
1240
1266
 
1241
1267
  .vpg-field-type-icon {
1242
1268
  width: 1.25rem;
@@ -1325,6 +1351,24 @@
1325
1351
 
1326
1352
  .vpg-auto-btn:hover { background: #d1fae5; }
1327
1353
 
1354
+ .vpg-calc-btn {
1355
+ display: flex;
1356
+ align-items: center;
1357
+ gap: 0.25rem;
1358
+ padding: 0.25rem 0.5rem;
1359
+ font-size: 0.6875rem;
1360
+ font-weight: 500;
1361
+ border-radius: 0.25rem;
1362
+ background: #fdf4ff;
1363
+ color: #a855f7;
1364
+ border: 1px solid #e9d5ff;
1365
+ cursor: pointer;
1366
+ transition: all 0.15s;
1367
+ }
1368
+
1369
+ .vpg-calc-btn:hover { background: #fae8ff; border-color: #d8b4fe; }
1370
+ .vpg-calc-icon { font-size: 0.75rem; font-weight: 700; }
1371
+
1328
1372
  .vpg-pivot-config .vpg-watermark {
1329
1373
  padding: 0.375rem 0.75rem;
1330
1374
  background: #f1f5f9;
@@ -1369,7 +1413,7 @@
1369
1413
  align-items: center;
1370
1414
  justify-content: space-between;
1371
1415
  padding: 0.5rem 1rem;
1372
- background: linear-gradient(to right, #ecfdf5, #f0fdfa);
1416
+ background: #f8fafc;
1373
1417
  border-bottom: 1px solid #e2e8f0;
1374
1418
  flex-shrink: 0;
1375
1419
  }
@@ -1613,8 +1657,8 @@
1613
1657
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
1614
1658
  }
1615
1659
 
1616
- .vpg-column-header-row { background: #e2e8f0; }
1617
- .vpg-column-header-row th { background: #e2e8f0; }
1660
+ .vpg-column-header-row { background: #f8fafc; }
1661
+ .vpg-column-header-row th { background: #f8fafc; }
1618
1662
 
1619
1663
  .vpg-row-header-label {
1620
1664
  position: sticky;
@@ -1626,13 +1670,13 @@
1626
1670
  font-weight: 600;
1627
1671
  color: #64748b;
1628
1672
  text-transform: uppercase;
1629
- border-bottom: 1px solid #cbd5e1;
1630
- border-right: 1px solid #cbd5e1;
1631
- background: #e2e8f0;
1673
+ border-bottom: 1px solid #e2e8f0;
1674
+ border-right: 1px solid #e2e8f0;
1675
+ background: #f8fafc;
1632
1676
  cursor: pointer;
1633
1677
  }
1634
1678
 
1635
- .vpg-row-header-label:hover { background: #d1d5db; }
1679
+ .vpg-row-header-label:hover { background: #f1f5f9; }
1636
1680
 
1637
1681
  .vpg-column-header-cell {
1638
1682
  padding: 0.5rem 0.75rem;
@@ -1640,14 +1684,14 @@
1640
1684
  font-size: 0.6875rem;
1641
1685
  font-weight: 600;
1642
1686
  color: #334155;
1643
- border-bottom: 1px solid #cbd5e1;
1644
- border-right: 1px solid #cbd5e1;
1687
+ border-bottom: 1px solid #e2e8f0;
1688
+ border-right: 1px solid #e2e8f0;
1645
1689
  white-space: nowrap;
1646
- background: #e2e8f0;
1690
+ background: #f8fafc;
1647
1691
  cursor: pointer;
1648
1692
  }
1649
1693
 
1650
- .vpg-column-header-cell:hover { background: rgba(203, 213, 225, 0.5); }
1694
+ .vpg-column-header-cell:hover { background: #f1f5f9; }
1651
1695
 
1652
1696
  .vpg-pivot-skeleton .vpg-header-content {
1653
1697
  display: flex;
@@ -1962,3 +2006,237 @@
1962
2006
  color: #e2e8f0;
1963
2007
  }
1964
2008
 
2009
+ /* ==========================================================================
2010
+ Calculated Field Modal
2011
+ ========================================================================== */
2012
+ .vpg-modal-overlay {
2013
+ position: fixed;
2014
+ inset: 0;
2015
+ background: rgba(0, 0, 0, 0.5);
2016
+ display: flex;
2017
+ align-items: center;
2018
+ justify-content: center;
2019
+ z-index: 9999;
2020
+ backdrop-filter: blur(2px);
2021
+ }
2022
+
2023
+ .vpg-modal {
2024
+ background: white;
2025
+ border-radius: 0.75rem;
2026
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
2027
+ width: 90%;
2028
+ max-width: 520px;
2029
+ max-height: 90vh;
2030
+ overflow: hidden;
2031
+ display: flex;
2032
+ flex-direction: column;
2033
+ }
2034
+
2035
+ .vpg-modal-header {
2036
+ display: flex;
2037
+ align-items: center;
2038
+ justify-content: space-between;
2039
+ padding: 1rem 1.25rem;
2040
+ border-bottom: 1px solid #e2e8f0;
2041
+ background: #f8fafc;
2042
+ }
2043
+
2044
+ .vpg-modal-header h3 {
2045
+ font-size: 1rem;
2046
+ font-weight: 600;
2047
+ color: #1e293b;
2048
+ margin: 0;
2049
+ }
2050
+
2051
+ .vpg-modal-close {
2052
+ width: 2rem;
2053
+ height: 2rem;
2054
+ display: flex;
2055
+ align-items: center;
2056
+ justify-content: center;
2057
+ font-size: 1.5rem;
2058
+ color: #64748b;
2059
+ background: transparent;
2060
+ border: none;
2061
+ border-radius: 0.375rem;
2062
+ cursor: pointer;
2063
+ transition: all 0.15s;
2064
+ }
2065
+
2066
+ .vpg-modal-close:hover { background: #e2e8f0; color: #1e293b; }
2067
+
2068
+ .vpg-modal-body {
2069
+ padding: 1.25rem;
2070
+ overflow-y: auto;
2071
+ flex: 1;
2072
+ }
2073
+
2074
+ .vpg-form-group { margin-bottom: 1rem; }
2075
+ .vpg-form-group-half { flex: 1; }
2076
+ .vpg-form-row { display: flex; gap: 1rem; }
2077
+
2078
+ .vpg-modal .vpg-label {
2079
+ display: block;
2080
+ font-size: 0.8125rem;
2081
+ font-weight: 600;
2082
+ color: #374151;
2083
+ margin-bottom: 0.375rem;
2084
+ }
2085
+
2086
+ .vpg-label-small {
2087
+ display: block;
2088
+ font-size: 0.6875rem;
2089
+ font-weight: 500;
2090
+ color: #64748b;
2091
+ margin-bottom: 0.375rem;
2092
+ text-transform: uppercase;
2093
+ letter-spacing: 0.05em;
2094
+ }
2095
+
2096
+ .vpg-input,
2097
+ .vpg-textarea,
2098
+ .vpg-select {
2099
+ width: 100%;
2100
+ padding: 0.5rem 0.75rem;
2101
+ font-size: 0.875rem;
2102
+ border: 1px solid #d1d5db;
2103
+ border-radius: 0.375rem;
2104
+ background: white;
2105
+ color: #1e293b;
2106
+ transition: all 0.15s;
2107
+ }
2108
+
2109
+ .vpg-input:focus,
2110
+ .vpg-textarea:focus,
2111
+ .vpg-select:focus {
2112
+ outline: none;
2113
+ border-color: #6366f1;
2114
+ box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
2115
+ }
2116
+
2117
+ .vpg-textarea { font-family: ui-monospace, monospace; resize: vertical; }
2118
+
2119
+ .vpg-button-group { display: flex; flex-wrap: wrap; gap: 0.375rem; }
2120
+ .vpg-field-buttons { max-height: 80px; overflow-y: auto; }
2121
+
2122
+ .vpg-insert-btn {
2123
+ padding: 0.25rem 0.5rem;
2124
+ font-size: 0.6875rem;
2125
+ font-weight: 600;
2126
+ background: #eef2ff;
2127
+ color: #4f46e5;
2128
+ border: 1px solid #c7d2fe;
2129
+ border-radius: 0.25rem;
2130
+ cursor: pointer;
2131
+ transition: all 0.15s;
2132
+ }
2133
+
2134
+ .vpg-insert-btn:hover { background: #e0e7ff; border-color: #a5b4fc; }
2135
+ .vpg-op-btn { min-width: 2rem; font-size: 0.875rem; font-weight: 500; }
2136
+
2137
+ .vpg-field-btn {
2138
+ background: #f0fdf4;
2139
+ color: #15803d;
2140
+ border-color: #bbf7d0;
2141
+ }
2142
+
2143
+ .vpg-field-btn:hover { background: #dcfce7; border-color: #86efac; }
2144
+
2145
+ .vpg-formula-hint {
2146
+ margin-top: 0.25rem;
2147
+ font-size: 0.6875rem;
2148
+ color: #64748b;
2149
+ }
2150
+
2151
+ .vpg-no-fields {
2152
+ font-size: 0.75rem;
2153
+ color: #94a3b8;
2154
+ font-style: italic;
2155
+ padding: 0.5rem;
2156
+ text-align: center;
2157
+ background: #f8fafc;
2158
+ border-radius: 0.375rem;
2159
+ }
2160
+
2161
+ .vpg-error {
2162
+ font-size: 0.75rem;
2163
+ color: #dc2626;
2164
+ margin-top: 0.25rem;
2165
+ }
2166
+
2167
+ .vpg-error-box {
2168
+ padding: 0.5rem 0.75rem;
2169
+ background: #fef2f2;
2170
+ border: 1px solid #fecaca;
2171
+ border-radius: 0.375rem;
2172
+ margin-top: 0.5rem;
2173
+ }
2174
+
2175
+ .vpg-modal-footer {
2176
+ display: flex;
2177
+ justify-content: flex-end;
2178
+ gap: 0.75rem;
2179
+ padding: 1rem 1.25rem;
2180
+ border-top: 1px solid #e2e8f0;
2181
+ background: #f8fafc;
2182
+ }
2183
+
2184
+ .vpg-btn {
2185
+ padding: 0.5rem 1rem;
2186
+ font-size: 0.875rem;
2187
+ font-weight: 500;
2188
+ border-radius: 0.375rem;
2189
+ cursor: pointer;
2190
+ transition: all 0.15s;
2191
+ }
2192
+
2193
+ .vpg-btn-secondary {
2194
+ background: white;
2195
+ color: #374151;
2196
+ border: 1px solid #d1d5db;
2197
+ }
2198
+
2199
+ .vpg-btn-secondary:hover { background: #f3f4f6; }
2200
+
2201
+ .vpg-btn-primary {
2202
+ background: #4f46e5;
2203
+ color: white;
2204
+ border: 1px solid #4f46e5;
2205
+ }
2206
+
2207
+ .vpg-btn-primary:hover { background: #4338ca; border-color: #4338ca; }
2208
+
2209
+ /* Dark mode - Modal */
2210
+ .vpg-theme-dark .vpg-modal { background: #1e293b; }
2211
+ .vpg-theme-dark .vpg-modal-header { background: #0f172a; border-color: #334155; }
2212
+ .vpg-theme-dark .vpg-modal-header h3 { color: #f1f5f9; }
2213
+ .vpg-theme-dark .vpg-modal-close { color: #94a3b8; }
2214
+ .vpg-theme-dark .vpg-modal-close:hover { background: #334155; color: #f1f5f9; }
2215
+ .vpg-theme-dark .vpg-modal .vpg-label { color: #e2e8f0; }
2216
+ .vpg-theme-dark .vpg-label-small { color: #94a3b8; }
2217
+ .vpg-theme-dark .vpg-input,
2218
+ .vpg-theme-dark .vpg-textarea,
2219
+ .vpg-theme-dark .vpg-select { background: #0f172a; border-color: #334155; color: #f1f5f9; }
2220
+ .vpg-theme-dark .vpg-input:focus,
2221
+ .vpg-theme-dark .vpg-textarea:focus,
2222
+ .vpg-theme-dark .vpg-select:focus { border-color: #6366f1; }
2223
+ .vpg-theme-dark .vpg-insert-btn { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.3); }
2224
+ .vpg-theme-dark .vpg-field-btn { background: rgba(34, 197, 94, 0.15); color: #86efac; border-color: rgba(34, 197, 94, 0.3); }
2225
+ .vpg-theme-dark .vpg-no-fields { background: #334155; color: #64748b; }
2226
+ .vpg-theme-dark .vpg-modal-footer { background: #0f172a; border-color: #334155; }
2227
+ .vpg-theme-dark .vpg-btn-secondary { background: #334155; color: #e2e8f0; border-color: #475569; }
2228
+ .vpg-theme-dark .vpg-btn-secondary:hover { background: #475569; }
2229
+ .vpg-theme-dark .vpg-error-box { background: rgba(220, 38, 38, 0.15); border-color: rgba(220, 38, 38, 0.3); }
2230
+
2231
+ /* Dark mode - Calculated fields in config */
2232
+ .vpg-theme-dark .vpg-assigned-item.vpg-type-calc { background: rgba(168, 85, 247, 0.15); border-color: rgba(168, 85, 247, 0.3); }
2233
+ .vpg-theme-dark .vpg-item-badge.calc { background: rgba(168, 85, 247, 0.3); color: #c4b5fd; }
2234
+ .vpg-theme-dark .vpg-field-item.vpg-is-calculated { border-color: rgba(168, 85, 247, 0.3); background: rgba(168, 85, 247, 0.1); }
2235
+ .vpg-theme-dark .vpg-calc-type { background: rgba(168, 85, 247, 0.4) !important; color: #c4b5fd !important; }
2236
+ .vpg-theme-dark .vpg-field-edit,
2237
+ .vpg-theme-dark .vpg-field-delete { color: #64748b; }
2238
+ .vpg-theme-dark .vpg-field-edit:hover { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
2239
+ .vpg-theme-dark .vpg-field-delete:hover { background: rgba(239, 68, 68, 0.2); color: #f87171; }
2240
+ .vpg-theme-dark .vpg-calc-btn { background: rgba(168, 85, 247, 0.15); color: #c084fc; border-color: rgba(168, 85, 247, 0.3); }
2241
+ .vpg-theme-dark .vpg-calc-btn:hover { background: rgba(168, 85, 247, 0.25); border-color: rgba(168, 85, 247, 0.5); }
2242
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smallwebco/tinypivot-react",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "TinyPivot React - Excel-like data grid and pivot table components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@tanstack/react-table": "^8.20.0",
29
- "@smallwebco/tinypivot-core": "1.0.24"
29
+ "@smallwebco/tinypivot-core": "1.0.25"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/react": "^18.2.0",