@dxos/lit-grid 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29
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/src/dx-grid-axis-resize-handle.d.ts.map +1 -1
- package/dist/src/dx-grid-multiselect-cell.d.ts.map +1 -1
- package/dist/src/dx-grid.d.ts +5 -4
- package/dist/src/dx-grid.d.ts.map +1 -1
- package/dist/src/dx-grid.js +24 -22
- package/dist/src/dx-grid.js.map +1 -1
- package/dist/src/dx-grid.lit-stories.d.ts +12 -15
- package/dist/src/dx-grid.lit-stories.d.ts.map +1 -1
- package/dist/src/dx-grid.lit-stories.js +5 -5
- package/dist/src/dx-grid.lit-stories.js.map +1 -1
- package/dist/src/playwright/playwright.config.d.ts.map +1 -1
- package/dist/src/playwright/playwright.config.js +1 -1
- package/dist/src/playwright/playwright.config.js.map +1 -1
- package/dist/src/testing/dx-grid-manager.d.ts.map +1 -1
- package/dist/src/testing/dx-grid-manager.js.map +1 -1
- package/dist/src/types.d.ts +3 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/util.d.ts +4 -4
- package/dist/src/util.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/src/dx-grid-axis-resize-handle.pcss +4 -4
- package/src/dx-grid-multiselect-cell.pcss +7 -5
- package/src/dx-grid.lit-stories.ts +3 -5
- package/src/dx-grid.pcss +30 -22
- package/src/dx-grid.ts +28 -23
- package/src/playwright/playwright.config.ts +1 -1
- package/src/types.ts +4 -0
package/package.json
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/lit-grid",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.dfabb4ec29",
|
|
4
4
|
"description": "A grid Web Component using Lit",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
|
-
"sideEffects":
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"*.css",
|
|
15
|
+
"*.pcss"
|
|
16
|
+
],
|
|
10
17
|
"type": "module",
|
|
11
18
|
"exports": {
|
|
12
19
|
".": {
|
|
@@ -23,23 +30,16 @@
|
|
|
23
30
|
},
|
|
24
31
|
"main": "dist/src/index.js",
|
|
25
32
|
"types": "dist/src/index.d.ts",
|
|
26
|
-
"typesVersions": {
|
|
27
|
-
"*": {
|
|
28
|
-
"testing": [
|
|
29
|
-
"dist/src/testing/index.d.ts"
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
33
|
"files": [
|
|
34
34
|
"src",
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@atlaskit/pragmatic-drag-and-drop": "
|
|
39
|
-
"lit": "^3.
|
|
38
|
+
"@atlaskit/pragmatic-drag-and-drop": "1.7.7",
|
|
39
|
+
"lit": "^3.3.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@dxos/random": "0.8.4-main.
|
|
43
|
-
"@dxos/test-utils": "0.8.4-main.
|
|
42
|
+
"@dxos/random": "0.8.4-main.dfabb4ec29",
|
|
43
|
+
"@dxos/test-utils": "0.8.4-main.dfabb4ec29"
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -7,24 +7,24 @@ dx-grid-axis-resize-handle {
|
|
|
7
7
|
background: transparent;
|
|
8
8
|
z-index: 2;
|
|
9
9
|
&:hover {
|
|
10
|
-
background: var(--
|
|
10
|
+
background: var(--color-hover-surface);
|
|
11
11
|
}
|
|
12
12
|
&[data-dx-grid-axis='col'] {
|
|
13
13
|
inset-block: 0;
|
|
14
14
|
inset-inline-end: 0;
|
|
15
|
-
inline-size: .5rem;
|
|
15
|
+
inline-size: 0.5rem;
|
|
16
16
|
cursor: col-resize;
|
|
17
17
|
}
|
|
18
18
|
&[data-dx-grid-axis='row'] {
|
|
19
19
|
inset-inline: 0;
|
|
20
20
|
inset-block-end: 0;
|
|
21
|
-
block-size: .5rem;
|
|
21
|
+
block-size: 0.5rem;
|
|
22
22
|
cursor: row-resize;
|
|
23
23
|
}
|
|
24
24
|
&:focus {
|
|
25
25
|
outline: none;
|
|
26
26
|
}
|
|
27
27
|
&:focus-visible {
|
|
28
|
-
background: var(--
|
|
28
|
+
background: var(--color-accent-surface);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
@reference "../../ui-theme/src/main.css";
|
|
2
|
+
|
|
1
3
|
dx-grid-multiselect-cell {
|
|
2
4
|
display: contents;
|
|
3
5
|
}
|
|
4
6
|
|
|
5
|
-
.dx-grid__cell__multiselect{
|
|
7
|
+
.dx-grid__cell__multiselect {
|
|
6
8
|
display: flex;
|
|
7
9
|
flex-flow: row nowrap;
|
|
8
10
|
gap: 2px;
|
|
@@ -14,19 +16,19 @@ dx-grid-multiselect-cell {
|
|
|
14
16
|
white-space: nowrap;
|
|
15
17
|
text-overflow: ellipsis;
|
|
16
18
|
&.dx-grid__cell__multiselect__value {
|
|
17
|
-
@apply
|
|
19
|
+
@apply h-full border border-separator text-xs font-semibold px-2 py-0.5 rounded cursor-default text-neutral-800 dark:text-neutral-200;
|
|
18
20
|
}
|
|
19
21
|
&.dx-grid__cell__multiselect__placeholder {
|
|
20
22
|
@apply text-description;
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
|
-
& > .dx-grid__cell__multiselect__separator{
|
|
25
|
+
& > .dx-grid__cell__multiselect__separator {
|
|
24
26
|
flex: 1 0 0;
|
|
25
27
|
}
|
|
26
28
|
& > svg {
|
|
27
29
|
flex: 0 0 auto;
|
|
28
|
-
margin-block: .25em;
|
|
30
|
+
margin-block: 0.25em;
|
|
29
31
|
inline-size: 1em;
|
|
30
32
|
block-size: 1em;
|
|
31
33
|
}
|
|
32
|
-
}
|
|
34
|
+
}
|
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
|
-
|
|
7
6
|
import './dx-grid.ts';
|
|
8
7
|
import './dx-grid.pcss';
|
|
9
|
-
|
|
10
8
|
import './dx-grid-multiselect-cell.ts';
|
|
11
9
|
|
|
12
10
|
import { html, nothing } from 'lit';
|
|
13
11
|
|
|
14
|
-
import {
|
|
12
|
+
import { random } from '@dxos/random';
|
|
15
13
|
|
|
16
14
|
import { defaultRowSize } from './defs.js';
|
|
17
15
|
import { type DxGridFrozenPlane, type DxGridPlaneCells, type DxGridProps } from './types';
|
|
@@ -39,7 +37,7 @@ const initialLabels = {
|
|
|
39
37
|
'0,0': { value: '', resizeHandle: 'col' },
|
|
40
38
|
},
|
|
41
39
|
frozenColsStart: [...Array(64)].reduce((acc, _, i) => {
|
|
42
|
-
acc[`0,${i}`] = { value: rowToA1Notation(i), className: 'text-end
|
|
40
|
+
acc[`0,${i}`] = { value: rowToA1Notation(i), className: 'text-end pe-1', resizeHandle: 'row' };
|
|
43
41
|
return acc;
|
|
44
42
|
}, {}),
|
|
45
43
|
frozenRowsStart: [...Array(12)].reduce((acc, _, i) => {
|
|
@@ -53,7 +51,7 @@ Basic.args = {
|
|
|
53
51
|
grid: {
|
|
54
52
|
'1,1': {
|
|
55
53
|
// end: '8,1',
|
|
56
|
-
value:
|
|
54
|
+
value: random.lorem.paragraphs(5),
|
|
57
55
|
},
|
|
58
56
|
'2,2': {
|
|
59
57
|
value: '',
|
package/src/dx-grid.pcss
CHANGED
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
@layer dx-tokens {
|
|
5
5
|
:root {
|
|
6
6
|
--dx-grid-cell-padding-block: 0.2rem;
|
|
7
|
-
--dx-grid-cell-content-padding-block: calc(
|
|
7
|
+
--dx-grid-cell-content-padding-block: calc(
|
|
8
|
+
var(--dx-grid-cell-padding-block) - var(--dx-grid-focus-indicator-width)
|
|
9
|
+
);
|
|
8
10
|
--dx-grid-cell-editor-padding-block: var(--dx-grid-cell-content-padding-block);
|
|
9
11
|
--dx-grid-cell-padding-inline: 0.25rem;
|
|
10
|
-
--dx-grid-cell-content-padding-inline: calc(
|
|
12
|
+
--dx-grid-cell-content-padding-inline: calc(
|
|
13
|
+
var(--dx-grid-cell-padding-inline) - var(--dx-grid-focus-indicator-width)
|
|
14
|
+
);
|
|
11
15
|
--dx-grid-cell-editor-padding-inline: var(--dx-grid-cell-content-padding-inline);
|
|
12
16
|
}
|
|
13
17
|
}
|
|
@@ -33,8 +37,6 @@
|
|
|
33
37
|
|
|
34
38
|
touch-action: none;
|
|
35
39
|
user-select: none;
|
|
36
|
-
|
|
37
|
-
background: var(--dx-grid-lines, var(--dx-gridLine));
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
.dx-grid__plane--frozen-row,
|
|
@@ -54,7 +56,7 @@
|
|
|
54
56
|
position: absolute;
|
|
55
57
|
inset: 0;
|
|
56
58
|
pointer-events: none;
|
|
57
|
-
border:
|
|
59
|
+
border: var(--dx-grid-focus-indicator-width) solid var(--color-grid-focus-indicator);
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
|
|
@@ -67,15 +69,18 @@
|
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
.dx-grid {
|
|
70
|
-
--
|
|
72
|
+
--grid-cell-surface: var(--color-grid-surface);
|
|
71
73
|
|
|
72
74
|
[role='gridcell'],
|
|
73
75
|
[role='columnheader'],
|
|
74
76
|
[role='rowheader'] {
|
|
75
|
-
background: var(--
|
|
77
|
+
background: var(--grid-cell-surface);
|
|
76
78
|
cursor: pointer;
|
|
77
79
|
position: relative;
|
|
78
80
|
|
|
81
|
+
border-right: 1px solid var(--color-grid-line);
|
|
82
|
+
border-bottom: 1px solid var(--color-grid-line);
|
|
83
|
+
|
|
79
84
|
&[aria-readonly='true'] {
|
|
80
85
|
cursor: default;
|
|
81
86
|
}
|
|
@@ -98,10 +103,11 @@
|
|
|
98
103
|
white-space: nowrap;
|
|
99
104
|
block-size: 100%;
|
|
100
105
|
position: relative;
|
|
101
|
-
border:
|
|
106
|
+
border: var(--dx-grid-focus-indicator-width) solid transparent;
|
|
102
107
|
border-radius: 2px;
|
|
103
108
|
|
|
104
|
-
&:has(.dx-tag),
|
|
109
|
+
&:has(.dx-tag),
|
|
110
|
+
&:has(dx-tag-picker-item) {
|
|
105
111
|
text-overflow: clip;
|
|
106
112
|
line-height: 0;
|
|
107
113
|
--dx-grid-cell-content-padding-inline: 1px;
|
|
@@ -110,7 +116,7 @@
|
|
|
110
116
|
}
|
|
111
117
|
|
|
112
118
|
&.dx-grid__cell--commented {
|
|
113
|
-
background: var(--
|
|
119
|
+
background: var(--color-grid-comment);
|
|
114
120
|
}
|
|
115
121
|
}
|
|
116
122
|
|
|
@@ -119,10 +125,11 @@
|
|
|
119
125
|
[role='columnheader'],
|
|
120
126
|
[role='rowheader'] {
|
|
121
127
|
&[aria-selected] {
|
|
122
|
-
--
|
|
128
|
+
--grid-cell-surface: var(--color-grid-selection-overlay);
|
|
123
129
|
|
|
124
130
|
&:focus:not([aria-readonly='true']),
|
|
125
|
-
&:focus-visible,
|
|
131
|
+
&:focus-visible,
|
|
132
|
+
&:focus-within {
|
|
126
133
|
& > .dx-grid__cell__content {
|
|
127
134
|
background: transparent;
|
|
128
135
|
}
|
|
@@ -140,7 +147,7 @@
|
|
|
140
147
|
}
|
|
141
148
|
|
|
142
149
|
&:has(.dx-grid__row--cta__cell:hover) .dx-grid__row--cta__cell {
|
|
143
|
-
background: var(--
|
|
150
|
+
background: var(--color-grid-hover-overlay);
|
|
144
151
|
}
|
|
145
152
|
}
|
|
146
153
|
|
|
@@ -149,7 +156,7 @@
|
|
|
149
156
|
[role='gridcell'],
|
|
150
157
|
[role='columnheader'],
|
|
151
158
|
[role='rowheader'] {
|
|
152
|
-
&:not([data-focus-unfurl=
|
|
159
|
+
&:not([data-focus-unfurl='false']):not(.dx-grid__cell--no-focus-unfurl) {
|
|
153
160
|
&:focus,
|
|
154
161
|
&:focus-within {
|
|
155
162
|
& > .dx-grid__cell__content {
|
|
@@ -171,17 +178,17 @@
|
|
|
171
178
|
|
|
172
179
|
z-index: 1;
|
|
173
180
|
|
|
174
|
-
background: var(--
|
|
181
|
+
background: var(--grid-cell-surface);
|
|
175
182
|
}
|
|
176
183
|
|
|
177
184
|
&:not([aria-readonly='true']) > .dx-grid__cell__content {
|
|
178
|
-
border-color: var(--
|
|
185
|
+
border-color: var(--color-grid-focus-indicator);
|
|
179
186
|
}
|
|
180
187
|
}
|
|
181
188
|
}
|
|
182
189
|
|
|
183
190
|
&:focus-visible > .dx-grid__cell__content {
|
|
184
|
-
border-color: var(--
|
|
191
|
+
border-color: var(--color-grid-focus-indicator);
|
|
185
192
|
}
|
|
186
193
|
}
|
|
187
194
|
}
|
|
@@ -192,8 +199,8 @@
|
|
|
192
199
|
hyphens: auto;
|
|
193
200
|
overflow-wrap: break-word;
|
|
194
201
|
|
|
195
|
-
background: var(--dx-grid-base, var(--
|
|
196
|
-
border:
|
|
202
|
+
background: var(--dx-grid-base, var(--color-base-surface));
|
|
203
|
+
border: var(--dx-grid-focus-indicator-width) solid var(--color-grid-focus-indicator);
|
|
197
204
|
border-radius: 2px;
|
|
198
205
|
|
|
199
206
|
--dx-grid-cell-editor-max-block-size: min(12em, 50vh);
|
|
@@ -204,7 +211,8 @@
|
|
|
204
211
|
inline-size: min-content;
|
|
205
212
|
max-inline-size: var(--dx-grid-cell-editor-max-inline-size);
|
|
206
213
|
|
|
207
|
-
&:has(.dx-tag),
|
|
214
|
+
&:has(.dx-tag),
|
|
215
|
+
&:has(dx-tag-picker-item) {
|
|
208
216
|
text-overflow: clip;
|
|
209
217
|
line-height: 0;
|
|
210
218
|
--dx-grid-cell-editor-padding-inline: 1px;
|
|
@@ -218,7 +226,7 @@
|
|
|
218
226
|
[role='columnheader'],
|
|
219
227
|
[role='rowheader'] {
|
|
220
228
|
&[data-dx-active]:not([aria-readonly='true']) > .dx-grid__cell__content {
|
|
221
|
-
border-color: var(--
|
|
229
|
+
border-color: var(--color-grid-focus-indicator);
|
|
222
230
|
}
|
|
223
231
|
}
|
|
224
232
|
}
|
|
@@ -246,7 +254,7 @@
|
|
|
246
254
|
inline-size: 0;
|
|
247
255
|
block-size: 0;
|
|
248
256
|
border-inline-start: 0.5em solid transparent;
|
|
249
|
-
border-block-start: 0.5em solid var(--
|
|
257
|
+
border-block-start: 0.5em solid var(--color-warning-text);
|
|
250
258
|
z-index: 1;
|
|
251
259
|
}
|
|
252
260
|
}
|
package/src/dx-grid.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import './dx-grid-axis-resize-handle';
|
|
6
|
+
|
|
5
7
|
import { LitElement, html, nothing } from 'lit';
|
|
6
8
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
7
9
|
import { type Ref, createRef, ref } from 'lit/directives/ref.js';
|
|
@@ -9,7 +11,6 @@ import { styleMap } from 'lit/directives/style-map.js';
|
|
|
9
11
|
import { html as staticHtml, unsafeStatic } from 'lit/static-html.js';
|
|
10
12
|
|
|
11
13
|
import { defaultColSize, defaultRowSize, focusUnfurlDefault } from './defs';
|
|
12
|
-
import './dx-grid-axis-resize-handle';
|
|
13
14
|
import {
|
|
14
15
|
DxAxisResize,
|
|
15
16
|
type DxAxisResizeInternal,
|
|
@@ -23,11 +24,13 @@ import {
|
|
|
23
24
|
type DxGridCells,
|
|
24
25
|
DxGridCellsSelect,
|
|
25
26
|
type DxGridFixedPlane,
|
|
27
|
+
type DxGridFocusIndicatorVariant,
|
|
26
28
|
type DxGridFrozenAxes,
|
|
27
29
|
type DxGridFrozenColsPlane,
|
|
28
30
|
type DxGridFrozenPlane,
|
|
29
31
|
type DxGridFrozenRowsPlane,
|
|
30
32
|
type DxGridMode,
|
|
33
|
+
type DxGridOverscroll,
|
|
31
34
|
type DxGridPlane,
|
|
32
35
|
type DxGridPlaneCellIndex,
|
|
33
36
|
type DxGridPlaneCells,
|
|
@@ -64,12 +67,12 @@ import {
|
|
|
64
67
|
export class DxGrid extends LitElement {
|
|
65
68
|
constructor() {
|
|
66
69
|
super();
|
|
67
|
-
// Wheel, top-level and element-level
|
|
70
|
+
// Wheel, top-level and element-level.
|
|
68
71
|
document.defaultView?.addEventListener('wheel', this.handleTopLevelWheel, { passive: false });
|
|
69
72
|
this.addEventListener('wheel', this.handleWheel);
|
|
70
|
-
// Custom event(s)
|
|
73
|
+
// Custom event(s).
|
|
71
74
|
this.addEventListener('dx-axis-resize-internal', this.handleAxisResizeInternal as EventListener);
|
|
72
|
-
// Standard events
|
|
75
|
+
// Standard events.
|
|
73
76
|
this.addEventListener('pointerdown', this.handlePointerDown);
|
|
74
77
|
this.addEventListener('pointermove', this.handlePointerMove);
|
|
75
78
|
this.addEventListener('pointerup', this.handlePointerUp);
|
|
@@ -114,11 +117,14 @@ export class DxGrid extends LitElement {
|
|
|
114
117
|
frozen: DxGridFrozenAxes = {};
|
|
115
118
|
|
|
116
119
|
@property({ type: String })
|
|
117
|
-
overscroll:
|
|
120
|
+
overscroll: DxGridOverscroll = undefined;
|
|
118
121
|
|
|
119
122
|
@property({ type: String })
|
|
120
123
|
activeRefs = '';
|
|
121
124
|
|
|
125
|
+
@property({ type: String })
|
|
126
|
+
focusIndicatorVariant: DxGridFocusIndicatorVariant = 'sheet';
|
|
127
|
+
|
|
122
128
|
/**
|
|
123
129
|
* When this function is defined, it is used first to try to get a value for a cell,
|
|
124
130
|
* and otherwise will fall back to `cells`.
|
|
@@ -194,6 +200,7 @@ export class DxGrid extends LitElement {
|
|
|
194
200
|
//
|
|
195
201
|
// `template` is the rendered value of `grid-{axis}-template`.
|
|
196
202
|
//
|
|
203
|
+
|
|
197
204
|
@state()
|
|
198
205
|
private templateGridColumns = '0';
|
|
199
206
|
|
|
@@ -317,7 +324,7 @@ export class DxGrid extends LitElement {
|
|
|
317
324
|
this.dispatchSelectionChange();
|
|
318
325
|
}
|
|
319
326
|
if (this.mode === 'edit-select') {
|
|
320
|
-
// Prevent focus moving when editing while selection is possible
|
|
327
|
+
// Prevent focus moving when editing while selection is possible.
|
|
321
328
|
event.preventDefault();
|
|
322
329
|
} else if (this.focusActive && isSameCell(this.focusedCell, cellCoords)) {
|
|
323
330
|
this.dispatchEditRequest();
|
|
@@ -425,15 +432,13 @@ export class DxGrid extends LitElement {
|
|
|
425
432
|
}
|
|
426
433
|
|
|
427
434
|
private moveFocusIntoPlane(plane: DxGridPlane): void {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
};
|
|
436
|
-
}
|
|
435
|
+
const colPlane = resolveColPlane(plane);
|
|
436
|
+
const rowPlane = resolveRowPlane(plane);
|
|
437
|
+
this.focusedCell = {
|
|
438
|
+
plane,
|
|
439
|
+
col: colPlane === 'grid' ? this.visColMin : 0,
|
|
440
|
+
row: rowPlane === 'grid' ? this.visRowMin : 0,
|
|
441
|
+
};
|
|
437
442
|
this.focusedCellElement()?.focus({ preventScroll: true });
|
|
438
443
|
}
|
|
439
444
|
|
|
@@ -590,7 +595,7 @@ export class DxGrid extends LitElement {
|
|
|
590
595
|
}
|
|
591
596
|
|
|
592
597
|
//
|
|
593
|
-
// Resize & reposition handlers, observer, ref
|
|
598
|
+
// Resize & reposition handlers, observer, ref.
|
|
594
599
|
//
|
|
595
600
|
|
|
596
601
|
@state()
|
|
@@ -690,7 +695,7 @@ export class DxGrid extends LitElement {
|
|
|
690
695
|
};
|
|
691
696
|
|
|
692
697
|
private updateVisInline(): void {
|
|
693
|
-
// todo: avoid starting from zero
|
|
698
|
+
// todo: avoid starting from zero.
|
|
694
699
|
let axisCursor = 0;
|
|
695
700
|
let pxCursor = this.colSize(axisCursor, 'grid');
|
|
696
701
|
|
|
@@ -748,7 +753,7 @@ export class DxGrid extends LitElement {
|
|
|
748
753
|
}
|
|
749
754
|
|
|
750
755
|
private updateVisBlock(): void {
|
|
751
|
-
// todo: avoid starting from zero
|
|
756
|
+
// todo: avoid starting from zero.
|
|
752
757
|
let axisCursor = 0;
|
|
753
758
|
let pxCursor = this.rowSize(axisCursor, 'grid');
|
|
754
759
|
|
|
@@ -1024,7 +1029,7 @@ export class DxGrid extends LitElement {
|
|
|
1024
1029
|
}
|
|
1025
1030
|
|
|
1026
1031
|
/**
|
|
1027
|
-
* Updates `pos` so that a cell in focus is fully within the viewport
|
|
1032
|
+
* Updates `pos` so that a cell in focus is fully within the viewport.
|
|
1028
1033
|
*/
|
|
1029
1034
|
snapPosToFocusedCell(): void {
|
|
1030
1035
|
const outOfVis = this.focusedCellOutOfVis();
|
|
@@ -1152,7 +1157,7 @@ export class DxGrid extends LitElement {
|
|
|
1152
1157
|
}
|
|
1153
1158
|
|
|
1154
1159
|
//
|
|
1155
|
-
// Render and other lifecycle methods
|
|
1160
|
+
// Render and other lifecycle methods.
|
|
1156
1161
|
//
|
|
1157
1162
|
|
|
1158
1163
|
// TODO(thure): This is for rendering presentational objects superimposed onto the canonical grid (e.g. DnD drop line for #8108).
|
|
@@ -1443,6 +1448,7 @@ export class DxGrid extends LitElement {
|
|
|
1443
1448
|
data-dx-grid-action="cell"
|
|
1444
1449
|
aria-colindex=${col}
|
|
1445
1450
|
aria-rowindex=${row}
|
|
1451
|
+
data-testid=${`${plane}.${col}.${row}`}
|
|
1446
1452
|
style="grid-column:${visCol + 1};grid-row:${visRow + 1}"
|
|
1447
1453
|
>
|
|
1448
1454
|
<div role="none" class="dx-grid__cell__content">${cell?.value}${accessory}</div>
|
|
@@ -1471,9 +1477,7 @@ export class DxGrid extends LitElement {
|
|
|
1471
1477
|
.split(' ')
|
|
1472
1478
|
.filter((value) => value)
|
|
1473
1479
|
.map(
|
|
1474
|
-
|
|
1475
|
-
(activeRef) =>
|
|
1476
|
-
`[data-refs~="${activeRef}"] { background: var(--dx-grid-commented-active, var(--dx-gridCommentedActive)) !important; }`,
|
|
1480
|
+
(activeRef) => `[data-refs~="${activeRef}"] { background: var(--color-grid-comment-active) !important; }`,
|
|
1477
1481
|
)
|
|
1478
1482
|
.join('\n')}
|
|
1479
1483
|
</style>
|
|
@@ -1507,6 +1511,7 @@ export class DxGrid extends LitElement {
|
|
|
1507
1511
|
})}
|
|
1508
1512
|
data-grid=${this.gridId}
|
|
1509
1513
|
data-grid-mode=${this.mode}
|
|
1514
|
+
data-grid-focus-indicator-variant=${this.focusIndicatorVariant}
|
|
1510
1515
|
?data-grid-select=${selection.visible}
|
|
1511
1516
|
${ref(this.gridRef)}
|
|
1512
1517
|
>
|
|
@@ -10,7 +10,7 @@ export default defineConfig({
|
|
|
10
10
|
...e2ePreset(import.meta.dirname),
|
|
11
11
|
// TODO(wittjosiah): Avoid hard-coding ports.
|
|
12
12
|
webServer: {
|
|
13
|
-
command: '
|
|
13
|
+
command: 'pnpm storybook dev --ci --quiet --port=9002 --config-dir=.storybook',
|
|
14
14
|
port: 9002,
|
|
15
15
|
reuseExistingServer: false,
|
|
16
16
|
},
|
package/src/types.ts
CHANGED
|
@@ -128,6 +128,10 @@ export type DxGridSelectionProps = {
|
|
|
128
128
|
visible?: boolean;
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
+
export type DxGridFocusIndicatorVariant = 'sheet' | 'stack';
|
|
132
|
+
|
|
133
|
+
export type DxGridOverscroll = 'inline' | 'block' | 'trap' | undefined;
|
|
134
|
+
|
|
131
135
|
export class DxAxisResize extends Event {
|
|
132
136
|
public readonly axis: DxGridAxis;
|
|
133
137
|
public readonly plane: 'grid' | DxGridFrozenPlane;
|