@keenmate/web-grid 1.1.0 → 1.2.0-rc01
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 +8 -8
- package/dist/grid.d.ts +95 -11
- package/dist/logger.d.ts +1 -0
- package/dist/modules/click-events/index.d.ts +5 -1
- package/dist/modules/contextmenu/index.d.ts +10 -1
- package/dist/modules/datepicker/datepicker.d.ts +2 -0
- package/dist/modules/rendering/tree-render.d.ts +8 -0
- package/dist/perf.d.ts +15 -0
- package/dist/types.d.ts +14 -4
- package/dist/web-component.d.ts +21 -3
- package/dist/web-grid.js +2922 -2397
- package/dist/web-grid.umd.js +100 -105
- package/package.json +9 -3
- package/src/css/_navigation.css +7 -2
- package/src/css/_tree.css +29 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keenmate/web-grid",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-rc01",
|
|
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",
|
|
@@ -36,7 +36,10 @@
|
|
|
36
36
|
"build:types": "tsc",
|
|
37
37
|
"preview": "vite preview",
|
|
38
38
|
"clean": "rimraf dist --glob \"*.tgz\"",
|
|
39
|
-
"clean:dist": "rimraf dist"
|
|
39
|
+
"clean:dist": "rimraf dist",
|
|
40
|
+
"test": "vitest run",
|
|
41
|
+
"test:watch": "vitest",
|
|
42
|
+
"test:ui": "vitest --ui"
|
|
40
43
|
},
|
|
41
44
|
"keywords": [
|
|
42
45
|
"grid",
|
|
@@ -69,9 +72,12 @@
|
|
|
69
72
|
},
|
|
70
73
|
"homepage": "https://github.com/KeenMate/web-grid#readme",
|
|
71
74
|
"devDependencies": {
|
|
75
|
+
"@vitest/ui": "^2.1.0",
|
|
76
|
+
"happy-dom": "^15.0.0",
|
|
72
77
|
"rimraf": "^5.0.5",
|
|
73
78
|
"typescript": "^5.3.3",
|
|
74
|
-
"vite": "^5.0.8"
|
|
79
|
+
"vite": "^5.0.8",
|
|
80
|
+
"vitest": "^2.1.0"
|
|
75
81
|
},
|
|
76
82
|
"dependencies": {
|
|
77
83
|
"@floating-ui/dom": "^1.7.4"
|
package/src/css/_navigation.css
CHANGED
|
@@ -19,8 +19,13 @@
|
|
|
19
19
|
inset calc(-1 * var(--wg-cell-splitter-width)) 0 0 var(--wg-cell-splitter-color);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
/* Focused cell styling
|
|
23
|
-
|
|
22
|
+
/* Focused cell styling (.wg__cell--focused class).
|
|
23
|
+
Applies whenever focusedCell state is set, in any grid mode. Read-only grids
|
|
24
|
+
(default editTrigger, isEditable: false) still set focusedCell on click via
|
|
25
|
+
the cell-selection module; the indicator needs to be visible there too,
|
|
26
|
+
otherwise tree-shortcut Ctrl+Arrows look like they're losing focus after a
|
|
27
|
+
re-render destroys/rebuilds the tbody. */
|
|
28
|
+
.wg__cell.wg__cell--focused {
|
|
24
29
|
box-shadow:
|
|
25
30
|
inset 0 0 0 var(--wg-focus-border-width) var(--wg-focus-border-color),
|
|
26
31
|
inset calc(-1 * var(--wg-cell-splitter-width)) 0 0 var(--wg-cell-splitter-color);
|
package/src/css/_tree.css
CHANGED
|
@@ -2,70 +2,68 @@
|
|
|
2
2
|
TREE COLUMN
|
|
3
3
|
==============================================================================
|
|
4
4
|
Indent + chevron rendered inside a cell when column.isTree is true.
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Inline-flex wrapper: chevron (or leaf spacer) + cell-body sit on one row.
|
|
6
|
+
Per-level depth comes from `padding-inline-start: level * --wg-tree-indent`,
|
|
7
|
+
set inline by JS.
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
10
|
:host {
|
|
10
|
-
--wg-tree-indent: 1.
|
|
11
|
-
--wg-tree-chevron-size:
|
|
11
|
+
--wg-tree-indent: 1.25rem; /* per-level indent */
|
|
12
|
+
--wg-tree-chevron-size: 1rem; /* chevron width/height (also used for leaf spacer) */
|
|
12
13
|
--wg-tree-chevron-color: var(--wg-text-color-2);
|
|
13
|
-
--wg-tree-chevron-gap:
|
|
14
|
+
--wg-tree-chevron-gap: 4px; /* gap between chevron and content */
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
.wg__tree-cell {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/* padding-
|
|
21
|
-
padding to be included in the width so the wrapper exactly fills the cell. */
|
|
22
|
-
box-sizing: border-box;
|
|
23
|
-
/* Fill the cell vertically so clicks anywhere inside the cell land on the
|
|
24
|
-
wrapper, not the cell's padding band. Helps for the dblclick-toggle hit area. */
|
|
25
|
-
min-height: 100%;
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--wg-tree-chevron-gap);
|
|
21
|
+
/* `padding-inline-start: level * --wg-tree-indent` is set inline by JS */
|
|
26
22
|
}
|
|
27
23
|
|
|
28
|
-
.wg__tree-cell-
|
|
24
|
+
.wg__tree-cell-body {
|
|
25
|
+
min-width: 0;
|
|
29
26
|
overflow: hidden;
|
|
30
27
|
text-overflow: inherit;
|
|
31
28
|
white-space: inherit;
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
.wg__tree-chevron {
|
|
35
|
-
|
|
36
|
-
top: 50%;
|
|
37
|
-
/* `left` is set inline by JS = level * indent */
|
|
38
|
-
transform: translateY(-50%);
|
|
32
|
+
all: unset;
|
|
39
33
|
display: inline-flex;
|
|
40
34
|
align-items: center;
|
|
41
35
|
justify-content: center;
|
|
42
36
|
width: var(--wg-tree-chevron-size);
|
|
43
37
|
height: var(--wg-tree-chevron-size);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
background: transparent;
|
|
47
|
-
color: var(--wg-tree-chevron-color);
|
|
48
|
-
font-size: 0.9em;
|
|
38
|
+
border-radius: 2px;
|
|
39
|
+
font-size: 0.85em;
|
|
49
40
|
line-height: 1;
|
|
41
|
+
color: var(--wg-tree-chevron-color);
|
|
50
42
|
cursor: pointer;
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
flex-shrink: 0;
|
|
44
|
+
transition: transform 0.12s ease, background 0.1s ease;
|
|
53
45
|
}
|
|
54
46
|
|
|
55
47
|
.wg__tree-chevron:hover:not(.wg__tree-chevron--leaf) {
|
|
56
48
|
background: var(--wg-hover-bg);
|
|
57
49
|
}
|
|
58
50
|
|
|
59
|
-
.wg__tree-chevron--
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
.wg__tree-chevron--expanded {
|
|
52
|
+
transform: rotate(90deg);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.wg__tree-leaf-spacer {
|
|
56
|
+
display: inline-block;
|
|
57
|
+
width: var(--wg-tree-chevron-size);
|
|
58
|
+
height: var(--wg-tree-chevron-size);
|
|
59
|
+
flex-shrink: 0;
|
|
63
60
|
}
|
|
64
61
|
|
|
65
62
|
/* While the cell is being edited, let the editor absolute-fill the <td> as it
|
|
66
63
|
normally does. The chevron/indent are visual aids for display mode; they come
|
|
67
64
|
back when editing ends. */
|
|
68
|
-
.wg__cell--editing .wg__tree-chevron
|
|
65
|
+
.wg__cell--editing .wg__tree-chevron,
|
|
66
|
+
.wg__cell--editing .wg__tree-leaf-spacer {
|
|
69
67
|
display: none;
|
|
70
68
|
}
|
|
71
69
|
.wg__cell--editing .wg__tree-cell {
|