@keenmate/web-grid 1.0.0-rc14 → 1.0.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.
- package/README.md +1 -1
- package/ai/INDEX.txt +360 -0
- package/ai/basic-setup.txt +165 -0
- package/ai/callbacks-events.txt +297 -0
- package/ai/columns.txt +486 -0
- package/ai/dropdown-editors.txt +504 -0
- package/ai/editing.txt +545 -0
- package/ai/fill-handle.txt +128 -0
- package/ai/frozen-columns.txt +142 -0
- package/ai/grid-modes.txt +267 -0
- package/ai/keyboard-navigation.txt +429 -0
- package/ai/public-methods.txt +231 -0
- package/ai/row-locking.txt +214 -0
- package/ai/selection.txt +403 -0
- package/ai/sorting-filtering-pagination.txt +375 -0
- package/ai/styling-theming.txt +291 -0
- package/ai/toolbar-actions.txt +475 -0
- package/ai/typescript-types.txt +498 -0
- package/ai/virtual-scroll.txt +146 -0
- package/dist/grid.d.ts +4 -0
- package/dist/modules/navigation/focus.d.ts +10 -0
- package/dist/modules/navigation/index.d.ts +1 -1
- package/dist/modules/types.d.ts +1 -0
- package/dist/web-component.d.ts +1 -0
- package/dist/web-grid.js +955 -865
- package/dist/web-grid.umd.js +52 -51
- package/package.json +2 -1
- package/src/css/_cell-selection.css +5 -3
- package/src/css/_cells.css +5 -2
- package/src/css/_freeze.css +10 -5
- package/src/css/_navigation.css +21 -14
- package/src/css/_selection.css +5 -3
- package/src/css/_variables.css +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keenmate/web-grid",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Framework-agnostic data grid web component with sorting, filtering, inline editing, and keyboard navigation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/web-grid.umd.js",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"files": [
|
|
28
28
|
"dist",
|
|
29
29
|
"src/css",
|
|
30
|
+
"ai",
|
|
30
31
|
"component-variables.manifest.json"
|
|
31
32
|
],
|
|
32
33
|
"scripts": {
|
|
@@ -26,12 +26,14 @@
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/* Range border - thick blue border around entire range
|
|
29
|
-
Shown during drag AND after selection completes
|
|
29
|
+
Shown during drag AND after selection completes.
|
|
30
|
+
z-index must be below frozen cells (sticky, z-index: 1-2) so the border
|
|
31
|
+
scrolls behind frozen columns instead of bleeding over them. */
|
|
30
32
|
.wg__cell-range-border {
|
|
31
33
|
position: absolute;
|
|
32
34
|
border: var(--wg-cell-selection-border-width) solid var(--wg-cell-selection-border);
|
|
33
35
|
pointer-events: none;
|
|
34
|
-
z-index:
|
|
36
|
+
z-index: 0;
|
|
35
37
|
box-sizing: border-box;
|
|
36
38
|
border-radius: 1px;
|
|
37
39
|
}
|
|
@@ -67,7 +69,7 @@
|
|
|
67
69
|
position: absolute;
|
|
68
70
|
border: var(--wg-selection-border-width) solid var(--wg-selection-border-color);
|
|
69
71
|
pointer-events: none;
|
|
70
|
-
z-index:
|
|
72
|
+
z-index: 0;
|
|
71
73
|
box-sizing: border-box;
|
|
72
74
|
border-radius: 1px;
|
|
73
75
|
}
|
package/src/css/_cells.css
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
color: var(--wg-cell-color);
|
|
10
10
|
height: var(--wg-row-min-height); /* In table layout, height acts as min-height */
|
|
11
11
|
box-sizing: border-box; /* Include padding in width calculation */
|
|
12
|
+
/* Positioned ancestor for absolute children (checkbox, edit button, etc.) */
|
|
13
|
+
position: relative;
|
|
12
14
|
/* Account for sticky header when scrolling into view */
|
|
13
15
|
scroll-margin-top: calc(3.0 * var(--wg-rem));
|
|
14
16
|
scroll-margin-bottom: calc(0.5 * var(--wg-rem));
|
|
@@ -50,7 +52,6 @@
|
|
|
50
52
|
============================================================================== */
|
|
51
53
|
.wg__cell--editable {
|
|
52
54
|
cursor: pointer;
|
|
53
|
-
position: relative;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
.wg__cell--editable:hover {
|
|
@@ -96,7 +97,9 @@
|
|
|
96
97
|
|
|
97
98
|
/* ==============================================================================
|
|
98
99
|
READ-ONLY CELLS (permanent styling, not focus-related)
|
|
100
|
+
Only apply when the grid IS editable - distinguishes non-editable columns
|
|
101
|
+
from editable ones. When the entire grid is read-only, no gray background.
|
|
99
102
|
============================================================================== */
|
|
100
|
-
.wg--navigate-mode .wg__cell:not(.wg__cell--editable) {
|
|
103
|
+
.wg--editable.wg--navigate-mode .wg__cell:not(.wg__cell--editable) {
|
|
101
104
|
background: var(--wg-cell-readonly-bg);
|
|
102
105
|
}
|
package/src/css/_freeze.css
CHANGED
|
@@ -66,14 +66,19 @@
|
|
|
66
66
|
|
|
67
67
|
/* When a row is focused (master/detail)
|
|
68
68
|
Uses !important to beat striped (0,3,2) and hover (0,3,2) rules above.
|
|
69
|
-
Consistent with selected/column-selected/in-range rules below.
|
|
69
|
+
Consistent with selected/column-selected/in-range rules below.
|
|
70
|
+
|
|
71
|
+
Frozen cells MUST have opaque backgrounds — the normal selection/focus
|
|
72
|
+
variables are semi-transparent (color-mix with transparent), which lets
|
|
73
|
+
non-frozen content show through when it scrolls behind sticky columns.
|
|
74
|
+
Mix against the opaque frozen column base instead. */
|
|
70
75
|
.wg__row--focused > .wg__cell--frozen {
|
|
71
|
-
background: var(--wg-
|
|
76
|
+
background: color-mix(in srgb, var(--wg-accent-color) 10%, var(--wg-frozen-column-bg, var(--wg-surface-1))) !important;
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
/* Row selection on frozen cells */
|
|
75
80
|
.wg__row--selected > .wg__cell--frozen {
|
|
76
|
-
background: var(--wg-
|
|
81
|
+
background: color-mix(in srgb, var(--wg-accent-color) 15%, var(--wg-frozen-column-bg, var(--wg-surface-1))) !important;
|
|
77
82
|
}
|
|
78
83
|
|
|
79
84
|
/* Row number cells in selected rows - accent color (override above rule) */
|
|
@@ -84,12 +89,12 @@
|
|
|
84
89
|
|
|
85
90
|
/* Column selection on frozen cells */
|
|
86
91
|
.wg__cell--frozen.wg__cell--column-selected {
|
|
87
|
-
background: var(--wg-
|
|
92
|
+
background: color-mix(in srgb, var(--wg-accent-color) 15%, var(--wg-frozen-column-bg, var(--wg-surface-1))) !important;
|
|
88
93
|
}
|
|
89
94
|
|
|
90
95
|
/* Cell range selection on frozen cells */
|
|
91
96
|
.wg__cell--frozen.wg__cell--in-range {
|
|
92
|
-
background: var(--wg-
|
|
97
|
+
background: color-mix(in srgb, var(--wg-accent-color) 10%, var(--wg-frozen-column-bg, var(--wg-surface-1))) !important;
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
/* ==========================================================================
|
package/src/css/_navigation.css
CHANGED
|
@@ -8,22 +8,30 @@
|
|
|
8
8
|
cursor: cell;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
/*
|
|
12
|
-
|
|
11
|
+
/* Replace browser default focus outline with box-shadow on all cells.
|
|
12
|
+
Outline ignores z-index stacking and bleeds over frozen columns.
|
|
13
|
+
Box-shadow respects stacking contexts so frozen columns properly cover it.
|
|
14
|
+
Combines with the cell splitter shadow (from _cells.css) to keep the right-edge separator. */
|
|
15
|
+
.wg__cell:focus {
|
|
13
16
|
outline: none;
|
|
17
|
+
box-shadow:
|
|
18
|
+
inset 0 0 0 var(--wg-focus-border-width) var(--wg-focus-border-color),
|
|
19
|
+
inset calc(-1 * var(--wg-cell-splitter-width)) 0 0 var(--wg-cell-splitter-color);
|
|
14
20
|
}
|
|
15
21
|
|
|
16
|
-
/* Focused cell styling
|
|
17
|
-
.wg--
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
/* Focused cell styling for editable navigate mode (.wg__cell--focused class) */
|
|
23
|
+
.wg--editable .wg__cell.wg__cell--focused {
|
|
24
|
+
box-shadow:
|
|
25
|
+
inset 0 0 0 var(--wg-focus-border-width) var(--wg-focus-border-color),
|
|
26
|
+
inset calc(-1 * var(--wg-cell-splitter-width)) 0 0 var(--wg-cell-splitter-color);
|
|
20
27
|
}
|
|
21
28
|
|
|
22
29
|
/* Focus styling for always-editing mode (editTrigger: 'always' / input-matrix mode) */
|
|
23
|
-
/* In this mode,
|
|
30
|
+
/* In this mode, the <td> doesn't have :focus (the inner input does), so no specificity conflict */
|
|
24
31
|
.wg__cell.wg__cell--always-edit-focused {
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
box-shadow:
|
|
33
|
+
inset 0 0 0 var(--wg-focus-border-width) var(--wg-focus-border-color),
|
|
34
|
+
inset calc(-1 * var(--wg-cell-splitter-width)) 0 0 var(--wg-cell-splitter-color);
|
|
27
35
|
}
|
|
28
36
|
|
|
29
37
|
/* Hide hover border when cell is focused */
|
|
@@ -36,8 +44,7 @@
|
|
|
36
44
|
ROW FOCUS (master/detail patterns)
|
|
37
45
|
==============================================================================
|
|
38
46
|
Must be in this file (after _cells.css) so source order beats the
|
|
39
|
-
.wg--navigate-mode .wg__cell:not(.wg__cell--editable) readonly rule
|
|
40
|
-
at equal specificity (0,3,0).
|
|
47
|
+
.wg--editable.wg--navigate-mode .wg__cell:not(.wg__cell--editable) readonly rule.
|
|
41
48
|
*/
|
|
42
49
|
.wg__row--focused > .wg__cell {
|
|
43
50
|
background: var(--wg-row-focus-bg);
|
|
@@ -47,11 +54,11 @@
|
|
|
47
54
|
background: var(--wg-row-focus-row-number-bg);
|
|
48
55
|
}
|
|
49
56
|
|
|
50
|
-
/* Navigate mode: override read-only cell background (needs
|
|
51
|
-
.wg--navigate-mode .wg__row--focused > .wg__cell {
|
|
57
|
+
/* Navigate mode: override read-only cell background (needs higher specificity than _cells.css rule) */
|
|
58
|
+
.wg--editable.wg--navigate-mode .wg__row--focused > .wg__cell {
|
|
52
59
|
background: var(--wg-row-focus-bg);
|
|
53
60
|
}
|
|
54
61
|
|
|
55
|
-
.wg--navigate-mode .wg__row--focused > .wg__cell.wg__row-number {
|
|
62
|
+
.wg--editable.wg--navigate-mode .wg__row--focused > .wg__cell.wg__row-number {
|
|
56
63
|
background: var(--wg-row-focus-row-number-bg);
|
|
57
64
|
}
|
package/src/css/_selection.css
CHANGED
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
background: var(--wg-selection-bg);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
/* Selected row number cell - accent colored
|
|
11
|
+
/* Selected row number cell - accent colored
|
|
12
|
+
Needs .wg--editable prefix to beat the readonly rule in _cells.css
|
|
13
|
+
(.wg--editable.wg--navigate-mode .wg__cell:not(.wg__cell--editable)) which has specificity 0,4,0 */
|
|
12
14
|
.wg__row--selected > .wg__cell.wg__row-number,
|
|
13
|
-
.wg--navigate-mode .wg__row--selected > .wg__cell.wg__row-number {
|
|
15
|
+
.wg--editable.wg--navigate-mode .wg__row--selected > .wg__cell.wg__row-number {
|
|
14
16
|
background: var(--wg-selection-row-number-bg);
|
|
15
17
|
color: var(--wg-selection-row-number-color);
|
|
16
18
|
}
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
|
|
28
30
|
/* When already selected, hover doesn't change background */
|
|
29
31
|
.wg__row--selected > .wg__cell.wg__row-number:hover,
|
|
30
|
-
.wg--navigate-mode .wg__row--selected > .wg__cell.wg__row-number:hover {
|
|
32
|
+
.wg--editable.wg--navigate-mode .wg__row--selected > .wg__cell.wg__row-number:hover {
|
|
31
33
|
background: var(--wg-selection-row-number-bg);
|
|
32
34
|
color: var(--wg-selection-row-number-color);
|
|
33
35
|
}
|
package/src/css/_variables.css
CHANGED
|
@@ -280,6 +280,8 @@
|
|
|
280
280
|
========================================================================== */
|
|
281
281
|
--wg-focus-outline: 2px solid var(--wg-accent-color);
|
|
282
282
|
--wg-focus-outline-offset: -2px;
|
|
283
|
+
--wg-focus-border-width: 2px;
|
|
284
|
+
--wg-focus-border-color: var(--wg-accent-color);
|
|
283
285
|
--wg-focus-bg: var(--wg-hover-bg);
|
|
284
286
|
|
|
285
287
|
/* ==========================================================================
|