@kanunilabs/pivotgrid-react 1.8.4 → 1.8.6

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/styles.css CHANGED
@@ -282,34 +282,40 @@
282
282
  .pivot-bg-surface { background-color: var(--pivot-surface); }
283
283
  .pivot-bg-primary { background-color: var(--pivot-primary); color: var(--pivot-primary-foreground); }
284
284
 
285
- /* Custom Scrollbar for Pivot */
286
- .pivot-custom-scrollbar,
287
- .kanuni-pivot-root .custom-scrollbar {
285
+ /* Custom Scrollbar for Pivot.
286
+ `layout.scrollbarStyle: 'native'` (B.70) puts `kanuni-pivot-native-scrollbar` on the
287
+ pivot's root and every rule below steps aside. It has to be ABSENCE, not an
288
+ override: `scrollbar-width`, `scrollbar-color` or any ::-webkit-scrollbar
289
+ rule, even set to `auto`/`initial`, makes Chrome drop the classic bar for the
290
+ thin one. `:where()` keeps the specificity of the plain selector, so an app's
291
+ own override of these rules still wins as before. */
292
+ .pivot-custom-scrollbar:not(:where(.kanuni-pivot-native-scrollbar *)),
293
+ .kanuni-pivot-root .custom-scrollbar:not(:where(.kanuni-pivot-native-scrollbar *)) {
288
294
  scrollbar-width: thin;
289
295
  scrollbar-color: color-mix(in srgb, var(--pivot-border) 80%, transparent) transparent;
290
296
  }
291
297
 
292
- .pivot-custom-scrollbar::-webkit-scrollbar,
293
- .kanuni-pivot-root .custom-scrollbar::-webkit-scrollbar {
298
+ .pivot-custom-scrollbar:not(:where(.kanuni-pivot-native-scrollbar *))::-webkit-scrollbar,
299
+ .kanuni-pivot-root .custom-scrollbar:not(:where(.kanuni-pivot-native-scrollbar *))::-webkit-scrollbar {
294
300
  width: 8px;
295
301
  height: 8px;
296
302
  }
297
303
 
298
- .pivot-custom-scrollbar::-webkit-scrollbar-track,
299
- .kanuni-pivot-root .custom-scrollbar::-webkit-scrollbar-track {
304
+ .pivot-custom-scrollbar:not(:where(.kanuni-pivot-native-scrollbar *))::-webkit-scrollbar-track,
305
+ .kanuni-pivot-root .custom-scrollbar:not(:where(.kanuni-pivot-native-scrollbar *))::-webkit-scrollbar-track {
300
306
  background: transparent;
301
307
  }
302
308
 
303
- .pivot-custom-scrollbar::-webkit-scrollbar-thumb,
304
- .kanuni-pivot-root .custom-scrollbar::-webkit-scrollbar-thumb {
309
+ .pivot-custom-scrollbar:not(:where(.kanuni-pivot-native-scrollbar *))::-webkit-scrollbar-thumb,
310
+ .kanuni-pivot-root .custom-scrollbar:not(:where(.kanuni-pivot-native-scrollbar *))::-webkit-scrollbar-thumb {
305
311
  background-color: color-mix(in srgb, var(--pivot-border) 80%, transparent);
306
312
  border-radius: var(--pivot-radius-full);
307
313
  border: 2px solid transparent;
308
314
  background-clip: padding-box;
309
315
  }
310
316
 
311
- .pivot-custom-scrollbar::-webkit-scrollbar-thumb:hover,
312
- .kanuni-pivot-root .custom-scrollbar::-webkit-scrollbar-thumb:hover {
317
+ .pivot-custom-scrollbar:not(:where(.kanuni-pivot-native-scrollbar *))::-webkit-scrollbar-thumb:hover,
318
+ .kanuni-pivot-root .custom-scrollbar:not(:where(.kanuni-pivot-native-scrollbar *))::-webkit-scrollbar-thumb:hover {
313
319
  background-color: var(--pivot-text-muted);
314
320
  }
315
321
 
@@ -528,6 +534,15 @@
528
534
  line-height: 19px;
529
535
  }
530
536
 
537
+ /* B.82: `layout.textOverflow: 'clip'` cuts text off at the edge instead of ending it in an ellipsis: the chips (every
538
+ strip, the field list, the drag ghost) and the row-header values. The class is on the root (and on the portal host).
539
+ Number cells are not listed. */
540
+ .kanuni-pivot-text-clip .pivot-truncate,
541
+ .kanuni-pivot-text-clip .truncate,
542
+ .kanuni-pivot-text-clip .kanuni-pivot-table .kanuni-pivot-row-header {
543
+ text-overflow: clip;
544
+ }
545
+
531
546
  /* Row header cells */
532
547
  .kanuni-pivot-table .kanuni-pivot-row-header {
533
548
  font-size: var(--pivot-text-sm);
@@ -584,7 +599,7 @@
584
599
  /* Total cells (subtotals & grand total) */
585
600
  .kanuni-pivot-table .kanuni-pivot-cell-total {
586
601
  background: var(--pivot-total-bg, color-mix(in srgb, var(--pivot-border) 40%, var(--pivot-surface))) !important;
587
- font-weight: 600;
602
+ font-weight: var(--pivot-font-weight-total, 600);
588
603
  }
589
604
 
590
605
  /* Subtotal row */
@@ -593,7 +608,7 @@
593
608
  }
594
609
 
595
610
  .kanuni-pivot-table .kanuni-pivot-subtotal-row .kanuni-pivot-cell {
596
- font-weight: 600;
611
+ font-weight: var(--pivot-font-weight-total, 600);
597
612
  background: var(--pivot-total-bg, color-mix(in srgb, var(--pivot-border) 30%, var(--pivot-surface)));
598
613
  }
599
614
 
@@ -603,7 +618,7 @@
603
618
  }
604
619
 
605
620
  .kanuni-pivot-table .kanuni-pivot-grand-total-row .kanuni-pivot-cell {
606
- font-weight: 700;
621
+ font-weight: var(--pivot-font-weight-grand-total, 700);
607
622
  background: var(--pivot-total-bg, color-mix(in srgb, var(--pivot-border) 50%, var(--pivot-surface)));
608
623
  /* Drawn as an inset shadow (not border-top) so the grand-total row stays
609
624
  exactly ROW_HEIGHT tall — a real border would add 2px and desync the
@@ -621,7 +636,7 @@
621
636
  /* Header total columns */
622
637
  .kanuni-pivot-table .kanuni-pivot-header-total {
623
638
  background: color-mix(in srgb, var(--pivot-border) 40%, var(--pivot-surface)) !important;
624
- font-weight: 600 !important;
639
+ font-weight: var(--pivot-font-weight-header-total, 600) !important;
625
640
  }
626
641
 
627
642
  /* The column-header band reads --pivot-header-bg. Both renderers paint the
@@ -1194,6 +1209,10 @@
1194
1209
  anywhere, so the whole chip claims it; a CHOOSER chip drags only from its
1195
1210
  grip and lives in a long scrollable list, so only the grip does.
1196
1211
 
1212
+ Since B.61 the plain JS chips follow the React pattern below (they carry
1213
+ data-touch-hold too, and a non-passive touchmove cancels the pan once a
1214
+ hold has begun a drag): the capped strips must scroll under a finger.
1215
+
1197
1216
  The React renderer drags on TOUCH events after the same hold (Tekax
1198
1217
  B.35). Its sensor cancels the hold when the finger moves first and
1199
1218
  prevents the default of every touchmove after it, so a chip can let the
@@ -1395,6 +1414,33 @@
1395
1414
  color: var(--pivot-danger);
1396
1415
  background-color: color-mix(in srgb, var(--pivot-danger) 10%, transparent);
1397
1416
  }
1417
+ /* B.64 (plain JS): `layout.rowHeaderOverflow: 'scroll'` keeps the row-header
1418
+ widths and does not pin them; their sticky offset goes, the table scrolls
1419
+ sideways as a whole. Top stickiness (the header rows) is untouched. */
1420
+ .kanuni-pivot-rowheaders-scroll .kanuni-pivot-table .kanuni-pivot-rh-sticky {
1421
+ inset-inline-start: auto !important;
1422
+ }
1423
+
1424
+ /* B.74: `layout.areaChipOverflow: 'scroll'` puts this class on the pivot's root. The Values and Columns zones above
1425
+ the table keep their chips on one line and scroll it sideways instead of starting a second one. */
1426
+ .kanuni-pivot-area-chips-scroll .kanuni-pivot-table thead .kanuni-pivot-area-content {
1427
+ flex-wrap: nowrap;
1428
+ overflow-x: auto;
1429
+ overflow-y: hidden;
1430
+ overscroll-behavior-x: contain;
1431
+ }
1432
+ .kanuni-pivot-area-chips-scroll .kanuni-pivot-table thead .kanuni-pivot-area-content > * {
1433
+ flex-shrink: 0;
1434
+ }
1435
+
1436
+ /* B.62: `layout.showSummaryBadge: false` puts this class on the pivot's root. */
1437
+ .kanuni-pivot-no-summary-badge .kanuni-pivot-chip-badge {
1438
+ display: none;
1439
+ }
1440
+ /* B.62 addendum: `layout.showChipRemove: false` puts this class on the pivot's root. */
1441
+ .kanuni-pivot-no-chip-remove .kanuni-pivot-chip-remove {
1442
+ display: none;
1443
+ }
1398
1444
  /* A capped strip scrolls inside itself; the page does not take over at its ends. */
1399
1445
  .kanuni-pivot-area-content {
1400
1446
  overscroll-behavior-y: contain;
@@ -1413,14 +1459,23 @@
1413
1459
  /* B.61: on a phone the filter strip must leave the data its room. With 8-10
1414
1460
  filter chips the strip filled the whole 400-500px pivot and the first data
1415
1461
  row sat ~150px outside the box. At 768px and below the strip takes at most
1416
- 40% of the pivot's height and scrolls inside itself past that; this holds
1462
+ 30% of the pivot's height and scrolls inside itself past that; this holds
1417
1463
  WITH `layout.filterAreaMaxRows` set (a smaller cap still wins; a larger one
1418
- stops at 40%). Percent of a pivot whose box has no height is ignored, and
1419
- then the pivot is as tall as its contents anyway. */
1420
- @media (max-width: 768px) {
1464
+ stops at 30%). Percent of a pivot whose box has no height is ignored, and
1465
+ then the pivot is as tall as its contents anyway.
1466
+
1467
+ B.72: "768px" is the PIVOT'S OWN width (a container query on the wrapper), not
1468
+ the window's. Zoomed in on a desktop the window stays 1280 wide while the
1469
+ pivot's box shrinks to ~640px of layout; a media query never saw that, and
1470
+ the strip took the box. `inline-size` only: the width may not depend on the
1471
+ content (the wrapper is 100% wide in both renderers), the height does. */
1472
+ .kanuni-pivot-wrapper {
1473
+ container: kanuni-pivot / inline-size;
1474
+ }
1475
+ @container kanuni-pivot (max-width: 768px) {
1421
1476
  .kanuni-pivot-filter-strip {
1422
1477
  box-sizing: border-box;
1423
- max-height: 40%;
1478
+ max-height: 30%;
1424
1479
  min-height: 0;
1425
1480
  overflow: hidden;
1426
1481
  }
@@ -1435,6 +1490,41 @@
1435
1490
  min-height: 0;
1436
1491
  overflow-y: auto;
1437
1492
  }
1493
+ /* B.61 round 2: the Values and Columns zones are part of the sticky header
1494
+ and, stacked touch chips, grew to ~150px: with the strip and the column
1495
+ headers the first data row was left BELOW the scroll pane's visible part
1496
+ (iPhone 15 / Pixel 7, 395-450px pivot). A fixed cap, not a percent: their
1497
+ parent is a table cell, whose height is not definite. They scroll inside. */
1498
+ .kanuni-pivot-table thead .kanuni-pivot-area-dropzone {
1499
+ max-height: 88px;
1500
+ min-height: 0;
1501
+ }
1502
+ .kanuni-pivot-table thead .kanuni-pivot-area-content {
1503
+ min-height: 0;
1504
+ overflow-y: auto;
1505
+ overscroll-behavior-y: contain;
1506
+ }
1507
+ /* B.61 (zoomed desktop): a short pivot (`data-pivot-short`, set below 480px by core watchShortPivot). A 1100x500
1508
+ window at 175% gives a ~240px pivot: the 30% strip and the 88px zones above left NO data row in view (strip 71,
1509
+ sticky header 145, measured in Chrome). Each part keeps one chip row and scrolls inside; the data keeps at least
1510
+ 40% of the pivot. Never on a wide pivot: this sits inside the narrow container query. */
1511
+ .kanuni-pivot-wrapper[data-pivot-short] .kanuni-pivot-filter-strip {
1512
+ max-height: 44px;
1513
+ }
1514
+ .kanuni-pivot-wrapper[data-pivot-short] .kanuni-pivot-table thead .kanuni-pivot-area-dropzone {
1515
+ max-height: 40px;
1516
+ }
1517
+ }
1518
+ @media (pointer: coarse) {
1519
+ /* Touch chips are 44px tall: one row of them. */
1520
+ @container kanuni-pivot (max-width: 768px) {
1521
+ .kanuni-pivot-wrapper[data-pivot-short] .kanuni-pivot-filter-strip {
1522
+ max-height: 60px;
1523
+ }
1524
+ .kanuni-pivot-wrapper[data-pivot-short] .kanuni-pivot-table thead .kanuni-pivot-area-dropzone {
1525
+ max-height: 56px;
1526
+ }
1527
+ }
1438
1528
  }
1439
1529
 
1440
1530
  .kanuni-pivot-field-chip {
@@ -1448,7 +1538,7 @@
1448
1538
  box-shadow: var(--pivot-shadow-sm);
1449
1539
  border-radius: var(--pivot-border-radius-sm);
1450
1540
  font-size: 12px;
1451
- font-weight: 500;
1541
+ font-weight: var(--pivot-font-weight-chip, 500);
1452
1542
  transition: all 0.2s;
1453
1543
  }
1454
1544
  .kanuni-pivot-field-chip:hover {
@@ -1475,7 +1565,8 @@
1475
1565
  display: flex;
1476
1566
  align-items: center;
1477
1567
  gap: 2px;
1478
- margin-left: 4px;
1568
+ /* The space between the caption and the filter icon: `--pivot-chip-filter-gap` (B.62 addendum). */
1569
+ margin-left: var(--pivot-chip-filter-gap, 4px);
1479
1570
  opacity: 0;
1480
1571
  transition: opacity 0.2s;
1481
1572
  }
@@ -1947,6 +2038,9 @@ th > .kanuni-pivot-field-chip > .kanuni-pivot-field-chip-actions {
1947
2038
  }
1948
2039
  }
1949
2040
  @layer utilities {
2041
+ .kanuni-pivot-root .\@container {
2042
+ container-type: inline-size;
2043
+ }
1950
2044
  .kanuni-pivot-root .pointer-events-auto {
1951
2045
  pointer-events: auto;
1952
2046
  }
@@ -2176,6 +2270,9 @@ th > .kanuni-pivot-field-chip > .kanuni-pivot-field-chip-actions {
2176
2270
  .kanuni-pivot-root .flex-col {
2177
2271
  flex-direction: column;
2178
2272
  }
2273
+ .kanuni-pivot-root .flex-wrap {
2274
+ flex-wrap: wrap;
2275
+ }
2179
2276
  .kanuni-pivot-root .items-center {
2180
2277
  align-items: center;
2181
2278
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanunilabs/pivotgrid-react",
3
- "version": "1.8.4",
3
+ "version": "1.8.6",
4
4
  "description": "High-performance React pivot table with a Web Worker engine — drag-and-drop pivoting, filtering, sorting, theming and export",
5
5
  "keywords": [
6
6
  "react",
@@ -65,7 +65,7 @@
65
65
  "access": "public"
66
66
  },
67
67
  "dependencies": {
68
- "@kanunilabs/pivotgrid-core": "1.11.4"
68
+ "@kanunilabs/pivotgrid-core": "1.11.6"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@tailwindcss/postcss": "^4.3.0",