@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keenmate/web-grid",
3
- "version": "1.0.0-rc14",
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: 3;
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: 3;
72
+ z-index: 0;
71
73
  box-sizing: border-box;
72
74
  border-radius: 1px;
73
75
  }
@@ -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
  }
@@ -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-row-focus-bg) !important;
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-selection-bg) !important;
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-selection-bg) !important;
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-cell-selection-bg) !important;
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
  /* ==========================================================================
@@ -8,22 +8,30 @@
8
8
  cursor: cell;
9
9
  }
10
10
 
11
- /* Remove browser default focus outline - we handle it with .wg__cell--focused */
12
- .wg--navigate-mode .wg__cell:focus {
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 - Excel-like green border for ALL cells */
17
- .wg--navigate-mode .wg__cell.wg__cell--focused {
18
- outline: var(--wg-focus-outline);
19
- outline-offset: -2px;
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, wg--navigate-mode is not added, but we still need focus visual */
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
- outline: var(--wg-focus-outline);
26
- outline-offset: -2px;
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 0,3,0 specificity) */
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
  }
@@ -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
  }
@@ -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
  /* ==========================================================================