@keenmate/web-grid 1.0.5 → 1.1.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 +8 -5
- package/dist/grid.d.ts +86 -1
- package/dist/index.d.ts +1 -1
- package/dist/modules/rendering/tree-render.d.ts +10 -0
- package/dist/types.d.ts +35 -0
- package/dist/web-component.d.ts +28 -0
- package/dist/web-grid.js +3621 -3225
- package/dist/web-grid.umd.js +119 -119
- package/package.json +1 -1
- package/src/css/_table.css +7 -1
- package/src/css/_tree.css +73 -0
- package/src/css/main.css +1 -0
package/package.json
CHANGED
package/src/css/_table.css
CHANGED
|
@@ -67,7 +67,13 @@ web-grid:not(:defined) {
|
|
|
67
67
|
============================================================================== */
|
|
68
68
|
.wg__table {
|
|
69
69
|
width: 100%;
|
|
70
|
-
min-width: max-content
|
|
70
|
+
/* `min-width: max-content` was here to force the table to extend past the
|
|
71
|
+
container when column widths sum > container. But with table-layout: fixed,
|
|
72
|
+
the explicit column widths from the first row already cause that overflow
|
|
73
|
+
naturally — the min-width was redundant and triggered pathological
|
|
74
|
+
intrinsic-size computation in some browsers (Firefox especially) when cells
|
|
75
|
+
contained absolutely-positioned editors, blowing the filler width up to
|
|
76
|
+
hundreds of thousands of px. */
|
|
71
77
|
border-collapse: collapse;
|
|
72
78
|
table-layout: fixed;
|
|
73
79
|
background: var(--wg-table-bg);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* ==============================================================================
|
|
2
|
+
TREE COLUMN
|
|
3
|
+
==============================================================================
|
|
4
|
+
Indent + chevron rendered inside a cell when column.isTree is true.
|
|
5
|
+
The chevron is absolutely positioned so it can't affect row height; the
|
|
6
|
+
wrapper's padding-left reserves space for (level * indent + chevron + gap).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
:host {
|
|
10
|
+
--wg-tree-indent: 1.6rem; /* per-level indent */
|
|
11
|
+
--wg-tree-chevron-size: 1.6rem; /* chevron width/height */
|
|
12
|
+
--wg-tree-chevron-color: var(--wg-text-color-2);
|
|
13
|
+
--wg-tree-chevron-gap: var(--wg-spacing-xs);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.wg__tree-cell {
|
|
17
|
+
position: relative;
|
|
18
|
+
width: 100%;
|
|
19
|
+
min-width: 0;
|
|
20
|
+
/* padding-left + width: 100% would overflow the cell with content-box; force
|
|
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%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.wg__tree-cell-content {
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
text-overflow: inherit;
|
|
31
|
+
white-space: inherit;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.wg__tree-chevron {
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 50%;
|
|
37
|
+
/* `left` is set inline by JS = level * indent */
|
|
38
|
+
transform: translateY(-50%);
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
width: var(--wg-tree-chevron-size);
|
|
43
|
+
height: var(--wg-tree-chevron-size);
|
|
44
|
+
padding: 0;
|
|
45
|
+
border: 0;
|
|
46
|
+
background: transparent;
|
|
47
|
+
color: var(--wg-tree-chevron-color);
|
|
48
|
+
font-size: 0.9em;
|
|
49
|
+
line-height: 1;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
user-select: none;
|
|
52
|
+
border-radius: 3px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.wg__tree-chevron:hover:not(.wg__tree-chevron--leaf) {
|
|
56
|
+
background: var(--wg-hover-bg);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.wg__tree-chevron--leaf {
|
|
60
|
+
cursor: default;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
background: transparent;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* While the cell is being edited, let the editor absolute-fill the <td> as it
|
|
66
|
+
normally does. The chevron/indent are visual aids for display mode; they come
|
|
67
|
+
back when editing ends. */
|
|
68
|
+
.wg__cell--editing .wg__tree-chevron {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
.wg__cell--editing .wg__tree-cell {
|
|
72
|
+
display: contents; /* wrapper disappears from layout */
|
|
73
|
+
}
|