@dxos/lit-grid 0.6.12-main.c974201 → 0.6.12-main.f9d0246
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/lib/browser/index.mjs +275 -97
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/dx-grid-axis-resize-handle.d.ts +15 -0
- package/dist/types/src/dx-grid-axis-resize-handle.d.ts.map +1 -0
- package/dist/types/src/dx-grid.d.ts +19 -4
- package/dist/types/src/dx-grid.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +17 -3
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/dx-grid-axis-resize-handle.ts +83 -0
- package/src/dx-grid.lit-stories.ts +2 -2
- package/src/dx-grid.pcss +12 -11
- package/src/dx-grid.ts +136 -52
- package/src/types.ts +24 -3
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
// packages/ui/lit-grid/src/dx-grid.ts
|
|
2
|
-
import { LitElement, html, nothing } from "lit";
|
|
3
|
-
import { customElement, state, property, eventOptions } from "lit/decorators.js";
|
|
4
|
-
import { ref, createRef } from "lit/directives/ref.js";
|
|
2
|
+
import { LitElement as LitElement2, html as html2, nothing } from "lit";
|
|
3
|
+
import { customElement as customElement2, state, property as property2, eventOptions } from "lit/decorators.js";
|
|
4
|
+
import { ref as ref2, createRef } from "lit/directives/ref.js";
|
|
5
|
+
|
|
6
|
+
// packages/ui/lit-grid/src/dx-grid-axis-resize-handle.ts
|
|
7
|
+
import { draggable } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
8
|
+
import { disableNativeDragPreview } from "@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview";
|
|
9
|
+
import { preventUnhandled } from "@atlaskit/pragmatic-drag-and-drop/prevent-unhandled";
|
|
10
|
+
import { html, LitElement } from "lit";
|
|
11
|
+
import { customElement, property } from "lit/decorators.js";
|
|
12
|
+
import { ref } from "lit/directives/ref.js";
|
|
5
13
|
|
|
6
14
|
// packages/ui/lit-grid/src/util.ts
|
|
7
15
|
var separator = ",";
|
|
@@ -16,6 +24,19 @@ var DxAxisResize = class extends Event {
|
|
|
16
24
|
this.size = props.size;
|
|
17
25
|
}
|
|
18
26
|
};
|
|
27
|
+
var DxAxisResizeInternal = class extends Event {
|
|
28
|
+
constructor(props) {
|
|
29
|
+
super("dx-axis-resize-internal", {
|
|
30
|
+
composed: true,
|
|
31
|
+
bubbles: true
|
|
32
|
+
});
|
|
33
|
+
this.axis = props.axis;
|
|
34
|
+
this.index = props.index;
|
|
35
|
+
this.size = props.size;
|
|
36
|
+
this.delta = props.delta;
|
|
37
|
+
this.state = props.state;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
19
40
|
var DxEditRequest = class extends Event {
|
|
20
41
|
constructor(props) {
|
|
21
42
|
super("dx-edit-request");
|
|
@@ -36,13 +57,96 @@ var DxGridCellsSelect = class extends Event {
|
|
|
36
57
|
}
|
|
37
58
|
};
|
|
38
59
|
|
|
39
|
-
// packages/ui/lit-grid/src/dx-grid.ts
|
|
60
|
+
// packages/ui/lit-grid/src/dx-grid-axis-resize-handle.ts
|
|
40
61
|
function _ts_decorate(decorators, target, key, desc) {
|
|
41
62
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
42
63
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
43
64
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
44
65
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
45
66
|
}
|
|
67
|
+
var DxGridAxisResizeHandle = class extends LitElement {
|
|
68
|
+
constructor() {
|
|
69
|
+
super(...arguments);
|
|
70
|
+
this.axis = "row";
|
|
71
|
+
this.index = "-1";
|
|
72
|
+
this.size = 128;
|
|
73
|
+
this.dragStartSize = 128;
|
|
74
|
+
this.cleanup = null;
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
return html`<button class="dx-grid__resize-handle" ${ref(this.mount)}>
|
|
78
|
+
<span class="sr-only">Resize</span>
|
|
79
|
+
</button>`;
|
|
80
|
+
}
|
|
81
|
+
dispatchResize(location, state2) {
|
|
82
|
+
const client = this.axis === "row" ? "clientY" : "clientX";
|
|
83
|
+
const event = new DxAxisResizeInternal({
|
|
84
|
+
axis: this.axis,
|
|
85
|
+
size: this.dragStartSize,
|
|
86
|
+
index: this.index,
|
|
87
|
+
delta: location.current.input[client] - location.initial.input[client],
|
|
88
|
+
state: state2
|
|
89
|
+
});
|
|
90
|
+
this.dispatchEvent(event);
|
|
91
|
+
}
|
|
92
|
+
mount(element) {
|
|
93
|
+
this.cleanup?.();
|
|
94
|
+
const host = this;
|
|
95
|
+
if (element) {
|
|
96
|
+
this.cleanup = draggable({
|
|
97
|
+
element,
|
|
98
|
+
onGenerateDragPreview: ({ nativeSetDragImage }) => {
|
|
99
|
+
disableNativeDragPreview({
|
|
100
|
+
nativeSetDragImage
|
|
101
|
+
});
|
|
102
|
+
preventUnhandled.start();
|
|
103
|
+
},
|
|
104
|
+
onDragStart() {
|
|
105
|
+
host.dragStartSize = host.size;
|
|
106
|
+
},
|
|
107
|
+
onDrag({ location }) {
|
|
108
|
+
host.dispatchResize(location, "dragging");
|
|
109
|
+
},
|
|
110
|
+
onDrop({ location }) {
|
|
111
|
+
host.dispatchResize(location, "dropped");
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
disconnectedCallback() {
|
|
117
|
+
super.disconnectedCallback();
|
|
118
|
+
this.cleanup?.();
|
|
119
|
+
}
|
|
120
|
+
createRenderRoot() {
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
_ts_decorate([
|
|
125
|
+
property({
|
|
126
|
+
type: String
|
|
127
|
+
})
|
|
128
|
+
], DxGridAxisResizeHandle.prototype, "axis", void 0);
|
|
129
|
+
_ts_decorate([
|
|
130
|
+
property({
|
|
131
|
+
type: String
|
|
132
|
+
})
|
|
133
|
+
], DxGridAxisResizeHandle.prototype, "index", void 0);
|
|
134
|
+
_ts_decorate([
|
|
135
|
+
property({
|
|
136
|
+
type: Number
|
|
137
|
+
})
|
|
138
|
+
], DxGridAxisResizeHandle.prototype, "size", void 0);
|
|
139
|
+
DxGridAxisResizeHandle = _ts_decorate([
|
|
140
|
+
customElement("dx-grid-axis-resize-handle")
|
|
141
|
+
], DxGridAxisResizeHandle);
|
|
142
|
+
|
|
143
|
+
// packages/ui/lit-grid/src/dx-grid.ts
|
|
144
|
+
function _ts_decorate2(decorators, target, key, desc) {
|
|
145
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
146
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
147
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
148
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
149
|
+
}
|
|
46
150
|
var gap = 1;
|
|
47
151
|
var resizeTolerance = 8;
|
|
48
152
|
var overscanCol = 1;
|
|
@@ -87,9 +191,9 @@ var isSameCell = (a, b) => a && b && Number.isFinite(a.col) && Number.isFinite(a
|
|
|
87
191
|
var localChId = (c0) => `ch--${c0}`;
|
|
88
192
|
var localRhId = (r0) => `rh--${r0}`;
|
|
89
193
|
var getPage = (axis, event) => axis === "col" ? event.pageX : event.pageY;
|
|
90
|
-
var DxGrid = class extends
|
|
194
|
+
var DxGrid = class extends LitElement2 {
|
|
91
195
|
constructor() {
|
|
92
|
-
super(
|
|
196
|
+
super();
|
|
93
197
|
this.gridId = "default-grid-id";
|
|
94
198
|
this.rowDefault = {
|
|
95
199
|
size: 32
|
|
@@ -99,8 +203,14 @@ var DxGrid = class extends LitElement {
|
|
|
99
203
|
};
|
|
100
204
|
this.rows = {};
|
|
101
205
|
this.columns = {};
|
|
102
|
-
this.
|
|
206
|
+
this.initialCells = {};
|
|
103
207
|
this.mode = "browse";
|
|
208
|
+
/**
|
|
209
|
+
* When this function is defined, it is used first to try to get a value for a cell, and otherwise will fall back
|
|
210
|
+
* to `cells`.
|
|
211
|
+
*/
|
|
212
|
+
this.getCells = null;
|
|
213
|
+
this.cells = {};
|
|
104
214
|
//
|
|
105
215
|
// `pos`, short for ‘position’, is the position in pixels of the viewport from the origin.
|
|
106
216
|
//
|
|
@@ -190,12 +300,6 @@ var DxGrid = class extends LitElement {
|
|
|
190
300
|
};
|
|
191
301
|
this.handlePointerUp = (event) => {
|
|
192
302
|
if (this.pointer?.state === "resizing") {
|
|
193
|
-
const resizeEvent = new DxAxisResize({
|
|
194
|
-
axis: this.pointer.axis,
|
|
195
|
-
index: this.pointer.index,
|
|
196
|
-
size: this[this.pointer.axis === "col" ? "colSize" : "rowSize"](this.pointer.index)
|
|
197
|
-
});
|
|
198
|
-
this.dispatchEvent(resizeEvent);
|
|
199
303
|
} else {
|
|
200
304
|
const cell = closestCell(event.target);
|
|
201
305
|
if (cell) {
|
|
@@ -209,24 +313,7 @@ var DxGrid = class extends LitElement {
|
|
|
209
313
|
this.pointer = null;
|
|
210
314
|
};
|
|
211
315
|
this.handlePointerMove = (event) => {
|
|
212
|
-
if (this.pointer?.state === "
|
|
213
|
-
const delta = getPage(this.pointer.axis, event) - this.pointer.page;
|
|
214
|
-
if (this.pointer.axis === "col") {
|
|
215
|
-
const nextSize = Math.max(sizeColMin, Math.min(sizeColMax, this.pointer.size + delta));
|
|
216
|
-
this.colSizes = {
|
|
217
|
-
...this.colSizes,
|
|
218
|
-
[this.pointer.index]: nextSize
|
|
219
|
-
};
|
|
220
|
-
this.updateVisInline();
|
|
221
|
-
} else {
|
|
222
|
-
const nextSize = Math.max(sizeRowMin, Math.min(sizeRowMax, this.pointer.size + delta));
|
|
223
|
-
this.rowSizes = {
|
|
224
|
-
...this.rowSizes,
|
|
225
|
-
[this.pointer.index]: nextSize
|
|
226
|
-
};
|
|
227
|
-
this.updateVisBlock();
|
|
228
|
-
}
|
|
229
|
-
} else if (this.pointer?.state === "selecting") {
|
|
316
|
+
if (this.pointer?.state === "selecting") {
|
|
230
317
|
const cell = closestCell(event.target);
|
|
231
318
|
if (cell && (cell.col !== this.selectionEnd.col || cell.row !== this.selectionEnd.row)) {
|
|
232
319
|
this.selectionEnd = cell;
|
|
@@ -248,16 +335,32 @@ var DxGrid = class extends LitElement {
|
|
|
248
335
|
}
|
|
249
336
|
});
|
|
250
337
|
this.viewportRef = createRef();
|
|
338
|
+
this.maybeUpdateVis = () => {
|
|
339
|
+
if (this.posInline >= this.binInlineMin && this.posInline < this.binInlineMax && this.posBlock >= this.binBlockMin && this.posBlock < this.binBlockMax) {
|
|
340
|
+
} else {
|
|
341
|
+
this.updateVis();
|
|
342
|
+
}
|
|
343
|
+
};
|
|
251
344
|
this.handleWheel = ({ deltaX, deltaY }) => {
|
|
252
345
|
if (this.mode === "browse") {
|
|
253
346
|
this.posInline = Math.max(0, this.posInline + deltaX);
|
|
254
347
|
this.posBlock = Math.max(0, this.posBlock + deltaY);
|
|
255
|
-
|
|
256
|
-
} else {
|
|
257
|
-
this.updateVis();
|
|
258
|
-
}
|
|
348
|
+
this.maybeUpdateVis();
|
|
259
349
|
}
|
|
260
350
|
};
|
|
351
|
+
this.addEventListener("dx-axis-resize-internal", this.handleAxisResizeInternal);
|
|
352
|
+
this.addEventListener("wheel", this.handleWheel);
|
|
353
|
+
this.addEventListener("pointerdown", this.handlePointerDown);
|
|
354
|
+
this.addEventListener("pointermove", this.handlePointerMove);
|
|
355
|
+
this.addEventListener("pointerup", this.handlePointerUp);
|
|
356
|
+
this.addEventListener("pointerleave", this.handlePointerUp);
|
|
357
|
+
this.addEventListener("focus", this.handleFocus, {
|
|
358
|
+
capture: true
|
|
359
|
+
});
|
|
360
|
+
this.addEventListener("blur", this.handleBlur, {
|
|
361
|
+
capture: true
|
|
362
|
+
});
|
|
363
|
+
this.addEventListener("keydown", this.handleKeydown);
|
|
261
364
|
}
|
|
262
365
|
//
|
|
263
366
|
// Primary pointer and keyboard handlers
|
|
@@ -329,7 +432,8 @@ var DxGrid = class extends LitElement {
|
|
|
329
432
|
return this.rowSizes?.[r] ?? this.rowDefault.size;
|
|
330
433
|
}
|
|
331
434
|
cell(c, r) {
|
|
332
|
-
|
|
435
|
+
const index = `${c}${separator}${r}`;
|
|
436
|
+
return this.cells[index] ?? this.initialCells[index];
|
|
333
437
|
}
|
|
334
438
|
focusedCellBox() {
|
|
335
439
|
const cellElement = this.focusedCellElement();
|
|
@@ -485,6 +589,52 @@ var DxGrid = class extends LitElement {
|
|
|
485
589
|
}
|
|
486
590
|
}
|
|
487
591
|
//
|
|
592
|
+
// Map scroll DOM methods to virtualized value.
|
|
593
|
+
//
|
|
594
|
+
get scrollLeft() {
|
|
595
|
+
return this.posInline;
|
|
596
|
+
}
|
|
597
|
+
set scrollLeft(nextValue) {
|
|
598
|
+
this.posInline = nextValue;
|
|
599
|
+
this.maybeUpdateVis();
|
|
600
|
+
}
|
|
601
|
+
get scrollTop() {
|
|
602
|
+
return this.posBlock;
|
|
603
|
+
}
|
|
604
|
+
set scrollTop(nextValue) {
|
|
605
|
+
this.posBlock = nextValue;
|
|
606
|
+
this.maybeUpdateVis();
|
|
607
|
+
}
|
|
608
|
+
//
|
|
609
|
+
// Resize handlers
|
|
610
|
+
//
|
|
611
|
+
handleAxisResizeInternal(event) {
|
|
612
|
+
event.stopPropagation();
|
|
613
|
+
const { axis, delta, size, index, type } = event;
|
|
614
|
+
if (axis === "col") {
|
|
615
|
+
const nextSize = Math.max(sizeColMin, Math.min(sizeColMax, size + delta));
|
|
616
|
+
this.colSizes = {
|
|
617
|
+
...this.colSizes,
|
|
618
|
+
[index]: nextSize
|
|
619
|
+
};
|
|
620
|
+
this.updateVisInline();
|
|
621
|
+
} else {
|
|
622
|
+
const nextSize = Math.max(sizeRowMin, Math.min(sizeRowMax, size + delta));
|
|
623
|
+
this.rowSizes = {
|
|
624
|
+
...this.rowSizes,
|
|
625
|
+
[index]: nextSize
|
|
626
|
+
};
|
|
627
|
+
this.updateVisBlock();
|
|
628
|
+
}
|
|
629
|
+
if (type === "dropped") {
|
|
630
|
+
this.dispatchEvent(new DxAxisResize({
|
|
631
|
+
axis,
|
|
632
|
+
index,
|
|
633
|
+
size: this[axis === "col" ? "colSize" : "rowSize"](index)
|
|
634
|
+
}));
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
//
|
|
488
638
|
// Render and other lifecycle methods
|
|
489
639
|
//
|
|
490
640
|
render() {
|
|
@@ -497,19 +647,12 @@ var DxGrid = class extends LitElement {
|
|
|
497
647
|
const selectRowMin = Math.min(this.selectionStart.row, this.selectionEnd.row);
|
|
498
648
|
const selectRowMax = Math.max(this.selectionStart.row, this.selectionEnd.row);
|
|
499
649
|
const selectVisible = selectColMin !== selectColMax || selectRowMin !== selectRowMax;
|
|
500
|
-
return
|
|
650
|
+
return html2`<div
|
|
501
651
|
role="none"
|
|
502
652
|
class="dx-grid"
|
|
503
653
|
data-grid=${this.gridId}
|
|
504
654
|
data-grid-mode=${this.mode}
|
|
505
655
|
?data-grid-select=${selectVisible}
|
|
506
|
-
@pointerdown=${this.handlePointerDown}
|
|
507
|
-
@pointerup=${this.handlePointerUp}
|
|
508
|
-
@pointermove=${this.handlePointerMove}
|
|
509
|
-
@pointerleave=${this.handlePointerUp}
|
|
510
|
-
@focus=${this.handleFocus}
|
|
511
|
-
@blur=${this.handleBlur}
|
|
512
|
-
@keydown=${this.handleKeydown}
|
|
513
656
|
>
|
|
514
657
|
<div role="none" class="dx-grid__corner"></div>
|
|
515
658
|
<div role="none" class="dx-grid__columnheader">
|
|
@@ -522,15 +665,18 @@ var DxGrid = class extends LitElement {
|
|
|
522
665
|
...Array(visibleCols)
|
|
523
666
|
].map((_, c0) => {
|
|
524
667
|
const c = this.visColMin + c0;
|
|
525
|
-
return
|
|
668
|
+
return html2`<div
|
|
526
669
|
role="columnheader"
|
|
527
670
|
?inert=${c < 0}
|
|
528
671
|
style="block-size:${this.rowDefault.size}px;grid-column:${c0 + 1}/${c0 + 2};"
|
|
529
672
|
>
|
|
530
673
|
<span id=${localChId(c0)}>${colToA1Notation(c)}</span>
|
|
531
|
-
${(this.columns[c]?.resizeable ?? this.columnDefault.resizeable) &&
|
|
532
|
-
|
|
533
|
-
|
|
674
|
+
${(this.columns[c]?.resizeable ?? this.columnDefault.resizeable) && html2`<dx-grid-axis-resize-handle
|
|
675
|
+
axis="col"
|
|
676
|
+
index=${c}
|
|
677
|
+
size=${this.colSize(c)}
|
|
678
|
+
@dxaxisresizeinternal=${this.handleAxisResizeInternal}
|
|
679
|
+
></dx-grid-axis-resize-handle>`}
|
|
534
680
|
</div>`;
|
|
535
681
|
})}
|
|
536
682
|
</div>
|
|
@@ -546,16 +692,18 @@ var DxGrid = class extends LitElement {
|
|
|
546
692
|
...Array(visibleRows)
|
|
547
693
|
].map((_, r0) => {
|
|
548
694
|
const r = this.visRowMin + r0;
|
|
549
|
-
return
|
|
695
|
+
return html2`<div role="rowheader" ?inert=${r < 0} style="grid-row:${r0 + 1}/${r0 + 2}">
|
|
550
696
|
<span id=${localRhId(r0)}>${rowToA1Notation(r)}</span>
|
|
551
|
-
${(this.rows[r]?.resizeable ?? this.rowDefault.resizeable) &&
|
|
552
|
-
|
|
553
|
-
|
|
697
|
+
${(this.rows[r]?.resizeable ?? this.rowDefault.resizeable) && html2`<dx-grid-axis-resize-handle
|
|
698
|
+
axis="row"
|
|
699
|
+
index=${r}
|
|
700
|
+
size=${this.rowSize(r)}
|
|
701
|
+
></dx-grid-axis-resize-handle>`}
|
|
554
702
|
</div>`;
|
|
555
703
|
})}
|
|
556
704
|
</div>
|
|
557
705
|
</div>
|
|
558
|
-
<div role="grid" class="dx-grid__viewport" tabindex="0" @wheel=${this.handleWheel} ${
|
|
706
|
+
<div role="grid" class="dx-grid__viewport" tabindex="0" @wheel=${this.handleWheel} ${ref2(this.viewportRef)}>
|
|
559
707
|
<div
|
|
560
708
|
role="none"
|
|
561
709
|
class="dx-grid__content"
|
|
@@ -572,7 +720,7 @@ var DxGrid = class extends LitElement {
|
|
|
572
720
|
const cell = this.cell(c, r);
|
|
573
721
|
const active = this.focusActive && this.focusedCell.col === c && this.focusedCell.row === r;
|
|
574
722
|
const selected = c >= selectColMin && c <= selectColMax && r >= selectRowMin && r <= selectRowMax;
|
|
575
|
-
return
|
|
723
|
+
return html2`<div
|
|
576
724
|
role="gridcell"
|
|
577
725
|
tabindex="0"
|
|
578
726
|
?inert=${c < 0 || r < 0}
|
|
@@ -600,6 +748,18 @@ var DxGrid = class extends LitElement {
|
|
|
600
748
|
</div>`;
|
|
601
749
|
}
|
|
602
750
|
firstUpdated() {
|
|
751
|
+
if (this.getCells) {
|
|
752
|
+
this.cells = this.getCells({
|
|
753
|
+
start: {
|
|
754
|
+
col: this.visColMin,
|
|
755
|
+
row: this.visRowMin
|
|
756
|
+
},
|
|
757
|
+
end: {
|
|
758
|
+
col: this.visColMax,
|
|
759
|
+
row: this.visRowMax
|
|
760
|
+
}
|
|
761
|
+
});
|
|
762
|
+
}
|
|
603
763
|
this.observer.observe(this.viewportRef.value);
|
|
604
764
|
this.colSizes = Object.entries(this.columns).reduce((acc, [colId, colMeta]) => {
|
|
605
765
|
if (colMeta?.size) {
|
|
@@ -614,6 +774,20 @@ var DxGrid = class extends LitElement {
|
|
|
614
774
|
return acc;
|
|
615
775
|
}, {});
|
|
616
776
|
}
|
|
777
|
+
willUpdate(changedProperties) {
|
|
778
|
+
if (this.getCells && (changedProperties.has("initialCells") || changedProperties.has("visColMin") || changedProperties.has("visColMax") || changedProperties.has("visRowMin") || changedProperties.has("visRowMax"))) {
|
|
779
|
+
this.cells = this.getCells({
|
|
780
|
+
start: {
|
|
781
|
+
col: this.visColMin,
|
|
782
|
+
row: this.visRowMin
|
|
783
|
+
},
|
|
784
|
+
end: {
|
|
785
|
+
col: this.visColMax,
|
|
786
|
+
row: this.visRowMax
|
|
787
|
+
}
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
}
|
|
617
791
|
updated(changedProperties) {
|
|
618
792
|
if (this.focusActive && (changedProperties.has("visRowMin") || changedProperties.has("visColMin") || changedProperties.has("focusedCell"))) {
|
|
619
793
|
this.refocus();
|
|
@@ -629,128 +803,132 @@ var DxGrid = class extends LitElement {
|
|
|
629
803
|
return this;
|
|
630
804
|
}
|
|
631
805
|
};
|
|
632
|
-
|
|
633
|
-
|
|
806
|
+
_ts_decorate2([
|
|
807
|
+
property2({
|
|
634
808
|
type: String
|
|
635
809
|
})
|
|
636
810
|
], DxGrid.prototype, "gridId", void 0);
|
|
637
|
-
|
|
638
|
-
|
|
811
|
+
_ts_decorate2([
|
|
812
|
+
property2({
|
|
639
813
|
type: Object
|
|
640
814
|
})
|
|
641
815
|
], DxGrid.prototype, "rowDefault", void 0);
|
|
642
|
-
|
|
643
|
-
|
|
816
|
+
_ts_decorate2([
|
|
817
|
+
property2({
|
|
644
818
|
type: Object
|
|
645
819
|
})
|
|
646
820
|
], DxGrid.prototype, "columnDefault", void 0);
|
|
647
|
-
|
|
648
|
-
|
|
821
|
+
_ts_decorate2([
|
|
822
|
+
property2({
|
|
649
823
|
type: Object
|
|
650
824
|
})
|
|
651
825
|
], DxGrid.prototype, "rows", void 0);
|
|
652
|
-
|
|
653
|
-
|
|
826
|
+
_ts_decorate2([
|
|
827
|
+
property2({
|
|
654
828
|
type: Object
|
|
655
829
|
})
|
|
656
830
|
], DxGrid.prototype, "columns", void 0);
|
|
657
|
-
|
|
658
|
-
|
|
831
|
+
_ts_decorate2([
|
|
832
|
+
property2({
|
|
659
833
|
type: Object
|
|
660
834
|
})
|
|
661
|
-
], DxGrid.prototype, "
|
|
662
|
-
|
|
663
|
-
|
|
835
|
+
], DxGrid.prototype, "initialCells", void 0);
|
|
836
|
+
_ts_decorate2([
|
|
837
|
+
property2({
|
|
664
838
|
type: String
|
|
665
839
|
})
|
|
666
840
|
], DxGrid.prototype, "mode", void 0);
|
|
667
|
-
|
|
841
|
+
_ts_decorate2([
|
|
842
|
+
state()
|
|
843
|
+
], DxGrid.prototype, "cells", void 0);
|
|
844
|
+
_ts_decorate2([
|
|
668
845
|
state()
|
|
669
846
|
], DxGrid.prototype, "posInline", void 0);
|
|
670
|
-
|
|
847
|
+
_ts_decorate2([
|
|
671
848
|
state()
|
|
672
849
|
], DxGrid.prototype, "posBlock", void 0);
|
|
673
|
-
|
|
850
|
+
_ts_decorate2([
|
|
674
851
|
state()
|
|
675
852
|
], DxGrid.prototype, "sizeInline", void 0);
|
|
676
|
-
|
|
853
|
+
_ts_decorate2([
|
|
677
854
|
state()
|
|
678
855
|
], DxGrid.prototype, "sizeBlock", void 0);
|
|
679
|
-
|
|
856
|
+
_ts_decorate2([
|
|
680
857
|
state()
|
|
681
858
|
], DxGrid.prototype, "overscanInline", void 0);
|
|
682
|
-
|
|
859
|
+
_ts_decorate2([
|
|
683
860
|
state()
|
|
684
861
|
], DxGrid.prototype, "overscanBlock", void 0);
|
|
685
|
-
|
|
862
|
+
_ts_decorate2([
|
|
686
863
|
state()
|
|
687
864
|
], DxGrid.prototype, "binInlineMin", void 0);
|
|
688
|
-
|
|
865
|
+
_ts_decorate2([
|
|
689
866
|
state()
|
|
690
867
|
], DxGrid.prototype, "binInlineMax", void 0);
|
|
691
|
-
|
|
868
|
+
_ts_decorate2([
|
|
692
869
|
state()
|
|
693
870
|
], DxGrid.prototype, "binBlockMin", void 0);
|
|
694
|
-
|
|
871
|
+
_ts_decorate2([
|
|
695
872
|
state()
|
|
696
873
|
], DxGrid.prototype, "binBlockMax", void 0);
|
|
697
|
-
|
|
874
|
+
_ts_decorate2([
|
|
698
875
|
state()
|
|
699
876
|
], DxGrid.prototype, "visColMin", void 0);
|
|
700
|
-
|
|
877
|
+
_ts_decorate2([
|
|
701
878
|
state()
|
|
702
879
|
], DxGrid.prototype, "visColMax", void 0);
|
|
703
|
-
|
|
880
|
+
_ts_decorate2([
|
|
704
881
|
state()
|
|
705
882
|
], DxGrid.prototype, "visRowMin", void 0);
|
|
706
|
-
|
|
883
|
+
_ts_decorate2([
|
|
707
884
|
state()
|
|
708
885
|
], DxGrid.prototype, "visRowMax", void 0);
|
|
709
|
-
|
|
886
|
+
_ts_decorate2([
|
|
710
887
|
state()
|
|
711
888
|
], DxGrid.prototype, "templateColumns", void 0);
|
|
712
|
-
|
|
889
|
+
_ts_decorate2([
|
|
713
890
|
state()
|
|
714
891
|
], DxGrid.prototype, "templateRows", void 0);
|
|
715
|
-
|
|
892
|
+
_ts_decorate2([
|
|
716
893
|
state()
|
|
717
894
|
], DxGrid.prototype, "pointer", void 0);
|
|
718
|
-
|
|
895
|
+
_ts_decorate2([
|
|
719
896
|
state()
|
|
720
897
|
], DxGrid.prototype, "colSizes", void 0);
|
|
721
|
-
|
|
898
|
+
_ts_decorate2([
|
|
722
899
|
state()
|
|
723
900
|
], DxGrid.prototype, "rowSizes", void 0);
|
|
724
|
-
|
|
901
|
+
_ts_decorate2([
|
|
725
902
|
state()
|
|
726
903
|
], DxGrid.prototype, "focusActive", void 0);
|
|
727
|
-
|
|
904
|
+
_ts_decorate2([
|
|
728
905
|
state()
|
|
729
906
|
], DxGrid.prototype, "focusedCell", void 0);
|
|
730
|
-
|
|
907
|
+
_ts_decorate2([
|
|
731
908
|
state()
|
|
732
909
|
], DxGrid.prototype, "selectionStart", void 0);
|
|
733
|
-
|
|
910
|
+
_ts_decorate2([
|
|
734
911
|
state()
|
|
735
912
|
], DxGrid.prototype, "selectionEnd", void 0);
|
|
736
|
-
|
|
913
|
+
_ts_decorate2([
|
|
737
914
|
state()
|
|
738
915
|
], DxGrid.prototype, "observer", void 0);
|
|
739
|
-
|
|
916
|
+
_ts_decorate2([
|
|
740
917
|
eventOptions({
|
|
741
918
|
capture: true
|
|
742
919
|
})
|
|
743
920
|
], DxGrid.prototype, "handleFocus", null);
|
|
744
|
-
|
|
921
|
+
_ts_decorate2([
|
|
745
922
|
eventOptions({
|
|
746
923
|
capture: true
|
|
747
924
|
})
|
|
748
925
|
], DxGrid.prototype, "handleBlur", null);
|
|
749
|
-
DxGrid =
|
|
750
|
-
|
|
926
|
+
DxGrid = _ts_decorate2([
|
|
927
|
+
customElement2("dx-grid")
|
|
751
928
|
], DxGrid);
|
|
752
929
|
export {
|
|
753
930
|
DxAxisResize,
|
|
931
|
+
DxAxisResizeInternal,
|
|
754
932
|
DxEditRequest,
|
|
755
933
|
DxGrid,
|
|
756
934
|
DxGridCellsSelect
|