@kanunilabs/datagrid 1.9.8 → 1.9.10
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/datagrid.umd.js +10 -10
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/styles.css +145 -1
- package/package.json +3 -3
package/dist/styles.css
CHANGED
|
@@ -510,6 +510,9 @@
|
|
|
510
510
|
align-items: center;
|
|
511
511
|
flex: none;
|
|
512
512
|
height: 100%;
|
|
513
|
+
/* No double-tap-to-zoom on a cell: the grid counts the two taps itself and
|
|
514
|
+
opens the editor (P-7.3). Panning and pinch-zoom stay the browser's. */
|
|
515
|
+
touch-action: manipulation;
|
|
513
516
|
padding: 0 var(--dg-cell-padding-x);
|
|
514
517
|
border-inline-end: var(--dg-cell-border);
|
|
515
518
|
white-space: nowrap;
|
|
@@ -1200,14 +1203,41 @@
|
|
|
1200
1203
|
}
|
|
1201
1204
|
|
|
1202
1205
|
.kanuni-datagrid-card-title {
|
|
1206
|
+
display: flex;
|
|
1207
|
+
align-items: center;
|
|
1208
|
+
gap: 6px;
|
|
1203
1209
|
height: 22px;
|
|
1204
1210
|
line-height: 22px;
|
|
1205
1211
|
font-weight: 600;
|
|
1206
1212
|
white-space: nowrap;
|
|
1207
1213
|
overflow: hidden;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
.kanuni-datagrid-card-title-text {
|
|
1217
|
+
min-width: 0;
|
|
1218
|
+
overflow: hidden;
|
|
1208
1219
|
text-overflow: ellipsis;
|
|
1209
1220
|
}
|
|
1210
1221
|
|
|
1222
|
+
/* `rowStatus.icons` on a card: the glyph the table's status column holds
|
|
1223
|
+
(P-9; the row's marker still runs down the card's edge). */
|
|
1224
|
+
.kanuni-datagrid-card-title .kanuni-datagrid-status-icon {
|
|
1225
|
+
flex: none;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
/* A card that does something when pressed (P-9). `touch-action: manipulation`
|
|
1229
|
+
drops the double-tap zoom delay, so a tap answers at once. */
|
|
1230
|
+
.kanuni-datagrid-card--pressable {
|
|
1231
|
+
cursor: pointer;
|
|
1232
|
+
touch-action: manipulation;
|
|
1233
|
+
-webkit-tap-highlight-color: transparent;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
/* `cardView.renderCard`: the app draws the content; the grid keeps the box. */
|
|
1237
|
+
.kanuni-datagrid-card--custom {
|
|
1238
|
+
font-size: inherit;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1211
1241
|
.kanuni-datagrid-card-fields {
|
|
1212
1242
|
margin: 0;
|
|
1213
1243
|
}
|
|
@@ -2652,6 +2682,13 @@
|
|
|
2652
2682
|
position: static !important;
|
|
2653
2683
|
}
|
|
2654
2684
|
|
|
2685
|
+
|
|
2686
|
+
/* The printable copy of the grid, made at `beforeprint` so the column headers
|
|
2687
|
+
repeat on every page (P-15; see hooks/printTable.ts). Invisible on screen. */
|
|
2688
|
+
.kanuni-datagrid-print-table {
|
|
2689
|
+
display: none;
|
|
2690
|
+
}
|
|
2691
|
+
|
|
2655
2692
|
/* Rules that only make sense once the ink is on paper. */
|
|
2656
2693
|
@media print {
|
|
2657
2694
|
/* Release the page around the grid.
|
|
@@ -2681,6 +2718,25 @@
|
|
|
2681
2718
|
page-break-inside: avoid;
|
|
2682
2719
|
}
|
|
2683
2720
|
|
|
2721
|
+
/* Column headers on every page (P-15): the live canvas gives way to its
|
|
2722
|
+
<table> copy, whose <thead> the browser repeats. Rows never split. */
|
|
2723
|
+
.kanuni-datagrid-print [data-print-clone] {
|
|
2724
|
+
display: none !important;
|
|
2725
|
+
}
|
|
2726
|
+
.kanuni-datagrid-print .kanuni-datagrid-print-table {
|
|
2727
|
+
display: table;
|
|
2728
|
+
border-collapse: collapse;
|
|
2729
|
+
border-spacing: 0;
|
|
2730
|
+
}
|
|
2731
|
+
.kanuni-datagrid-print .kanuni-datagrid-print-table td {
|
|
2732
|
+
padding: 0;
|
|
2733
|
+
border: 0;
|
|
2734
|
+
}
|
|
2735
|
+
.kanuni-datagrid-print .kanuni-datagrid-print-table tr {
|
|
2736
|
+
break-inside: avoid;
|
|
2737
|
+
page-break-inside: avoid;
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2684
2740
|
/* Chrome and Safari drop background colours by default, which turns the
|
|
2685
2741
|
header, the group banners and the row striping into undifferentiated white.
|
|
2686
2742
|
The structure IS the meaning here, so ask for them back. */
|
|
@@ -2921,6 +2977,15 @@
|
|
|
2921
2977
|
margin: 0;
|
|
2922
2978
|
}
|
|
2923
2979
|
|
|
2980
|
+
/* A touch screen: never under 16 px while typing, or iOS Safari zooms the page
|
|
2981
|
+
into the box the moment it takes focus (Tekax 07, P.1 rule c). */
|
|
2982
|
+
@media (pointer: coarse) {
|
|
2983
|
+
.kanuni-datagrid-root .kanuni-datagrid-editor:not([type='checkbox']),
|
|
2984
|
+
.kanuni-datagrid-root .kanuni-datagrid-edit-form-input:not([type='checkbox']) {
|
|
2985
|
+
font-size: max(16px, var(--dg-font-size));
|
|
2986
|
+
}
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2924
2989
|
/* Edge to edge of the CELL, not of its padding box.
|
|
2925
2990
|
`width: 100%` resolves against the content box — the cell minus 2 ×
|
|
2926
2991
|
--dg-cell-padding-x — and a negative margin only shifts a box, it does not
|
|
@@ -2976,6 +3041,20 @@
|
|
|
2976
3041
|
border-bottom-color: var(--dg-danger);
|
|
2977
3042
|
}
|
|
2978
3043
|
|
|
3044
|
+
/* `lookup.restrictInput` (P-12): a short flash where a refused key landed. No
|
|
3045
|
+
message; the box keeps its text and caret. */
|
|
3046
|
+
.kanuni-datagrid-root .kanuni-datagrid-editor--refused {
|
|
3047
|
+
border-bottom-color: var(--dg-danger);
|
|
3048
|
+
animation: kanuni-datagrid-refused 240ms ease-in-out;
|
|
3049
|
+
}
|
|
3050
|
+
@keyframes kanuni-datagrid-refused {
|
|
3051
|
+
25% { transform: translateX(-2px); }
|
|
3052
|
+
75% { transform: translateX(2px); }
|
|
3053
|
+
}
|
|
3054
|
+
@media (prefers-reduced-motion: reduce) {
|
|
3055
|
+
.kanuni-datagrid-root .kanuni-datagrid-editor--refused { animation: none; }
|
|
3056
|
+
}
|
|
3057
|
+
|
|
2979
3058
|
/* The cell holding an editor gives up its focus ring — the underline is the
|
|
2980
3059
|
marker now, and the ring is the other half of the double rectangle.
|
|
2981
3060
|
It also goes to the plain surface colour: the row underneath may be striped,
|
|
@@ -3209,6 +3288,10 @@
|
|
|
3209
3288
|
}
|
|
3210
3289
|
|
|
3211
3290
|
.kanuni-datagrid-lookup-item {
|
|
3291
|
+
/* The editor windows the list by the item height it sets inline; the
|
|
3292
|
+
padding has to sit INSIDE it, or each item overlaps the next (and a
|
|
3293
|
+
44 px touch item measured 52). */
|
|
3294
|
+
box-sizing: border-box;
|
|
3212
3295
|
padding: 4px 8px;
|
|
3213
3296
|
line-height: 18px;
|
|
3214
3297
|
white-space: nowrap;
|
|
@@ -3217,6 +3300,29 @@
|
|
|
3217
3300
|
cursor: pointer;
|
|
3218
3301
|
}
|
|
3219
3302
|
|
|
3303
|
+
/* A code + name item (lookup.linkedColumns, P-5.2): the code in a fixed
|
|
3304
|
+
column so the names line up. */
|
|
3305
|
+
.kanuni-datagrid-lookup-code {
|
|
3306
|
+
display: inline-block;
|
|
3307
|
+
min-width: 7ch;
|
|
3308
|
+
margin-inline-end: 8px;
|
|
3309
|
+
font-weight: 600;
|
|
3310
|
+
font-variant-numeric: tabular-nums;
|
|
3311
|
+
}
|
|
3312
|
+
|
|
3313
|
+
/* Touch (pointer: coarse): 44 px items, 16 px text (K-53, P.1 rule c). The
|
|
3314
|
+
height itself is set by the editor, which windows the list by it. */
|
|
3315
|
+
.kanuni-datagrid-lookup-popup--touch .kanuni-datagrid-lookup-item {
|
|
3316
|
+
line-height: 36px;
|
|
3317
|
+
font-size: 16px;
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3320
|
+
/* A function lookup's label still on its way (P-5.1): nothing, not the code. */
|
|
3321
|
+
.kanuni-datagrid-lookup-pending {
|
|
3322
|
+
display: inline-block;
|
|
3323
|
+
min-width: 1em;
|
|
3324
|
+
}
|
|
3325
|
+
|
|
3220
3326
|
.kanuni-datagrid-lookup-item--active {
|
|
3221
3327
|
background: var(--dg-primary);
|
|
3222
3328
|
color: var(--dg-on-primary);
|
|
@@ -3681,14 +3787,30 @@ input[type='checkbox'].kanuni-datagrid-edit-form-input {
|
|
|
3681
3787
|
/* The success fill: every palette and scheme sets it, dark ones included. */
|
|
3682
3788
|
--dg-row-status-saved: var(--dg-success);
|
|
3683
3789
|
--dg-row-status-error: var(--dg-danger);
|
|
3790
|
+
/* P-2 (2026-10-31). A new row: the success colour — "added", as a diff reads
|
|
3791
|
+
it; a plus glyph tells it from the transient "saved" tick. A pending
|
|
3792
|
+
delete: the muted text colour, so it reads as greyed out and is never
|
|
3793
|
+
mistaken for the red of a refused save. Both stay at 3:1 or more against
|
|
3794
|
+
the row in every packaged scheme and palette (themes.test.ts measures
|
|
3795
|
+
them); an app's theme may set its own. */
|
|
3796
|
+
--dg-row-status-new: var(--dg-success);
|
|
3797
|
+
--dg-row-status-removed: var(--dg-text-muted);
|
|
3684
3798
|
/* How strongly `tint: true` washes the row. */
|
|
3685
3799
|
--dg-row-status-tint: 8%;
|
|
3686
3800
|
}
|
|
3687
3801
|
|
|
3802
|
+
.kanuni-datagrid-row--status-new {
|
|
3803
|
+
--dg-row-status-color: var(--dg-row-status-new);
|
|
3804
|
+
}
|
|
3805
|
+
|
|
3688
3806
|
.kanuni-datagrid-row--status-changed {
|
|
3689
3807
|
--dg-row-status-color: var(--dg-row-status-changed);
|
|
3690
3808
|
}
|
|
3691
3809
|
|
|
3810
|
+
.kanuni-datagrid-row--status-removed {
|
|
3811
|
+
--dg-row-status-color: var(--dg-row-status-removed);
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3692
3814
|
.kanuni-datagrid-row--status-saving {
|
|
3693
3815
|
--dg-row-status-color: var(--dg-row-status-saving);
|
|
3694
3816
|
}
|
|
@@ -3730,6 +3852,14 @@ input[type='checkbox'].kanuni-datagrid-edit-form-input {
|
|
|
3730
3852
|
);
|
|
3731
3853
|
}
|
|
3732
3854
|
|
|
3855
|
+
/* `rowStatus.strike`: a row whose status is `removed` — the grid's pending
|
|
3856
|
+
delete or the app's own status — has its text struck through, in every edit
|
|
3857
|
+
mode. The status glyph cell is left alone. */
|
|
3858
|
+
.kanuni-datagrid-row--status-strike .kanuni-datagrid-cell:not(.kanuni-datagrid-status-cell),
|
|
3859
|
+
.kanuni-datagrid-row--status-strike .kanuni-datagrid-card {
|
|
3860
|
+
text-decoration: line-through;
|
|
3861
|
+
}
|
|
3862
|
+
|
|
3733
3863
|
/* High contrast drops background colours; the marker is the whole signal,
|
|
3734
3864
|
so it keeps its own. */
|
|
3735
3865
|
@media (forced-colors: active) {
|
|
@@ -3805,7 +3935,7 @@ input[type='checkbox'].kanuni-datagrid-edit-form-input {
|
|
|
3805
3935
|
/* ── Status column (`rowStatus.icons`, 2026-10-16) ───────────
|
|
3806
3936
|
A glyph per status so it does not rest on colour alone: a dot while
|
|
3807
3937
|
changed, a turning ring while saving, a tick when saved, a triangle when
|
|
3808
|
-
refused. Drawn as a MASK filled with the status colour, so a palette or a
|
|
3938
|
+
refused, a plus for a new row and a cross for a pending delete (P-2). Drawn as a MASK filled with the status colour, so a palette or a
|
|
3809
3939
|
scheme recolours it like the marker. The cell exists on every row (an empty
|
|
3810
3940
|
one where there is no status) so the columns beside it never step. */
|
|
3811
3941
|
.kanuni-datagrid-status-cell {
|
|
@@ -3832,6 +3962,14 @@ input[type='checkbox'].kanuni-datagrid-edit-form-input {
|
|
|
3832
3962
|
--dg-row-status-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3.5'/%3E%3C/svg%3E");
|
|
3833
3963
|
}
|
|
3834
3964
|
|
|
3965
|
+
.kanuni-datagrid-row--status-new {
|
|
3966
|
+
--dg-row-status-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2.5v11M2.5 8h11' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
|
|
3967
|
+
}
|
|
3968
|
+
|
|
3969
|
+
.kanuni-datagrid-row--status-removed {
|
|
3970
|
+
--dg-row-status-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 3.5l9 9M12.5 3.5l-9 9' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3835
3973
|
.kanuni-datagrid-row--status-saving {
|
|
3836
3974
|
--dg-row-status-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2a6 6 0 1 1-6 6' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
|
|
3837
3975
|
}
|
|
@@ -4244,6 +4382,9 @@ input[type='checkbox'].kanuni-datagrid-edit-form-input {
|
|
|
4244
4382
|
/* NOT the accent: gold on white is 1.9:1 and a focus ring has to be seen.
|
|
4245
4383
|
brand-900 measures 7.0:1 on white. */
|
|
4246
4384
|
--dg-focus-ring: #6b5119;
|
|
4385
|
+
/* The "saving" marker is the accent elsewhere; gold on the white row is
|
|
4386
|
+
2.4:1, under the 3:1 a status bar needs (P-2 measurement). */
|
|
4387
|
+
--dg-row-status-saving: #6b5119;
|
|
4247
4388
|
--dg-on-primary: #1c1917;
|
|
4248
4389
|
--dg-selected-bg: #f3ead3;
|
|
4249
4390
|
--dg-group-bg: #faf6ed;
|
|
@@ -4711,6 +4852,9 @@ input[type='checkbox'].kanuni-datagrid-edit-form-input {
|
|
|
4711
4852
|
--dg-scrollbar-thumb: #4c566a;
|
|
4712
4853
|
--dg-danger: #bf616a; /* nord11 */
|
|
4713
4854
|
--dg-danger-text: #d9919a;
|
|
4855
|
+
/* The refused-save marker: nord11 is 2.8:1 on the striped row, under the
|
|
4856
|
+
3:1 a status bar needs (P-2 measurement). */
|
|
4857
|
+
--dg-row-status-error: #d9919a;
|
|
4714
4858
|
/* nord11 is a muted red, so the label on it has to go further down than the
|
|
4715
4859
|
usual near-black: #2b1113 measured 4.31:1 and this is 5.17:1. */
|
|
4716
4860
|
--dg-on-danger: #170709;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanunilabs/datagrid",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.10",
|
|
4
4
|
"description": "High-performance data grid for vanilla JavaScript — no framework required. Virtualized rows and columns, a Web Worker pipeline, sorting, filtering, grouping and theming, with a UMD build for script-tag use.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-grid",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@kanunilabs/datagrid-core": "1.10.
|
|
63
|
+
"@kanunilabs/datagrid-core": "1.10.10"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/node": "^22.0.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"jsdom": "^30.0.1",
|
|
69
69
|
"react": "^19.0.0",
|
|
70
70
|
"react-dom": "^19.0.0",
|
|
71
|
-
"@kanunilabs/datagrid-react": "1.8.
|
|
71
|
+
"@kanunilabs/datagrid-react": "1.8.10",
|
|
72
72
|
"@kanunilabs/foundation": "1.0.4"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|