@dxos/lit-grid 0.7.1 → 0.7.2-main.f1adc9f
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.d.ts +2 -0
- package/dist/src/dx-grid.d.ts.map +1 -1
- package/dist/src/dx-grid.js +37 -5
- package/dist/src/dx-grid.js.map +1 -1
- package/dist/src/dx-grid.lit-stories.d.ts +4 -1
- package/dist/src/dx-grid.lit-stories.d.ts.map +1 -1
- package/dist/src/dx-grid.lit-stories.js +14 -12
- package/dist/src/dx-grid.lit-stories.js.map +1 -1
- package/dist/src/testing/index.d.ts +2 -0
- package/dist/src/testing/index.d.ts.map +1 -0
- package/dist/src/testing/index.js +5 -0
- package/dist/src/testing/index.js.map +1 -0
- package/dist/src/testing/playwright/dx-grid-manager.d.ts +24 -0
- package/dist/src/testing/playwright/dx-grid-manager.d.ts.map +1 -0
- package/dist/src/testing/playwright/dx-grid-manager.js +79 -0
- package/dist/src/testing/playwright/dx-grid-manager.js.map +1 -0
- package/dist/src/testing/playwright/dx-grid.spec.d.ts +2 -0
- package/dist/src/testing/playwright/dx-grid.spec.d.ts.map +1 -0
- package/dist/src/testing/playwright/dx-grid.spec.js +92 -0
- package/dist/src/testing/playwright/dx-grid.spec.js.map +1 -0
- package/dist/src/testing/playwright/playwright.config.d.ts +3 -0
- package/dist/src/testing/playwright/playwright.config.d.ts.map +1 -0
- package/dist/src/testing/playwright/playwright.config.js +16 -0
- package/dist/src/testing/playwright/playwright.config.js.map +1 -0
- package/dist/src/types.d.ts +5 -3
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +4 -3
- package/dist/src/types.js.map +1 -1
- package/dist/src/util.d.ts +2 -5
- package/dist/src/util.d.ts.map +1 -1
- package/dist/src/util.js +3 -5
- package/dist/src/util.js.map +1 -1
- package/dist/types/src/dx-grid.d.ts +2 -0
- package/dist/types/src/dx-grid.d.ts.map +1 -1
- package/dist/types/src/dx-grid.js +37 -5
- package/dist/types/src/dx-grid.js.map +1 -1
- package/dist/types/src/dx-grid.lit-stories.d.ts +4 -1
- package/dist/types/src/dx-grid.lit-stories.d.ts.map +1 -1
- package/dist/types/src/dx-grid.lit-stories.js +14 -12
- package/dist/types/src/dx-grid.lit-stories.js.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/index.js +5 -0
- package/dist/types/src/testing/index.js.map +1 -0
- package/dist/types/src/testing/playwright/dx-grid-manager.d.ts +24 -0
- package/dist/types/src/testing/playwright/dx-grid-manager.d.ts.map +1 -0
- package/dist/types/src/testing/playwright/dx-grid-manager.js +79 -0
- package/dist/types/src/testing/playwright/dx-grid-manager.js.map +1 -0
- package/dist/types/src/testing/playwright/dx-grid.spec.d.ts +2 -0
- package/dist/types/src/testing/playwright/dx-grid.spec.d.ts.map +1 -0
- package/dist/types/src/testing/playwright/dx-grid.spec.js +92 -0
- package/dist/types/src/testing/playwright/dx-grid.spec.js.map +1 -0
- package/dist/types/src/testing/playwright/playwright.config.d.ts +3 -0
- package/dist/types/src/testing/playwright/playwright.config.d.ts.map +1 -0
- package/dist/types/src/testing/playwright/playwright.config.js +16 -0
- package/dist/types/src/testing/playwright/playwright.config.js.map +1 -0
- package/dist/types/src/types.d.ts +5 -3
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/types.js +4 -3
- package/dist/types/src/types.js.map +1 -1
- package/dist/types/src/util.d.ts +2 -5
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/src/util.js +3 -5
- package/dist/types/src/util.js.map +1 -1
- package/package.json +19 -3
- package/src/dx-grid.lit-stories.ts +14 -12
- package/src/dx-grid.pcss +3 -2
- package/src/dx-grid.ts +43 -7
- package/src/testing/index.ts +5 -0
- package/src/testing/playwright/dx-grid-manager.ts +110 -0
- package/src/testing/playwright/dx-grid.spec.ts +118 -0
- package/src/testing/playwright/playwright.config.ts +18 -0
- package/src/types.ts +9 -6
- package/src/util.ts +6 -5
package/src/types.ts
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type DxGrid } from './dx-grid';
|
|
6
|
-
import {
|
|
6
|
+
import { toPlaneCellIndex } from './util';
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export const separator = ',' as const;
|
|
9
|
+
|
|
10
|
+
export type DxGridPlaneCellIndex = `${string}${typeof separator}${string}`;
|
|
11
|
+
export type DxGridCellIndex = `${DxGridPlane}${typeof separator}${string}${typeof separator}${string}`;
|
|
9
12
|
|
|
10
13
|
export type DxGridAxis = 'row' | 'col';
|
|
11
14
|
|
|
@@ -28,7 +31,7 @@ export type DxGridAnnotatedPanEvent = (WheelEvent | PointerEvent) & { deltaX: nu
|
|
|
28
31
|
gridId: string;
|
|
29
32
|
}>;
|
|
30
33
|
|
|
31
|
-
export type DxGridPlaneCells = Record<
|
|
34
|
+
export type DxGridPlaneCells = Record<DxGridPlaneCellIndex, DxGridCellValue>;
|
|
32
35
|
export type DxGridCells = { grid: DxGridPlaneCells } & Partial<
|
|
33
36
|
Record<DxGridFixedPlane | DxGridFrozenPlane, DxGridPlaneCells>
|
|
34
37
|
>;
|
|
@@ -151,7 +154,7 @@ export class DxAxisResizeInternal extends Event {
|
|
|
151
154
|
export type DxEditRequestProps = Pick<DxEditRequest, 'cellIndex' | 'cellBox' | 'initialContent'>;
|
|
152
155
|
|
|
153
156
|
export class DxEditRequest extends Event {
|
|
154
|
-
public readonly cellIndex:
|
|
157
|
+
public readonly cellIndex: DxGridPlaneCellIndex;
|
|
155
158
|
public readonly cellBox: Record<'insetInlineStart' | 'insetBlockStart' | 'inlineSize' | 'blockSize', number>;
|
|
156
159
|
public readonly initialContent?: string;
|
|
157
160
|
constructor(props: DxEditRequestProps) {
|
|
@@ -174,8 +177,8 @@ export class DxGridCellsSelect extends Event {
|
|
|
174
177
|
public readonly maxRow: number;
|
|
175
178
|
constructor({ start, end }: DxGridRange) {
|
|
176
179
|
super('dx-grid-cells-select');
|
|
177
|
-
this.start =
|
|
178
|
-
this.end =
|
|
180
|
+
this.start = toPlaneCellIndex(start);
|
|
181
|
+
this.end = toPlaneCellIndex(end);
|
|
179
182
|
this.minCol = Math.min(start.col, end.col);
|
|
180
183
|
this.maxCol = Math.max(start.col, end.col);
|
|
181
184
|
this.minRow = Math.min(start.row, end.row);
|
package/src/util.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { defaultSizeRow } from './defs';
|
|
6
6
|
import {
|
|
7
|
+
type DxGridPlaneCellIndex,
|
|
7
8
|
type DxGridCellIndex,
|
|
8
9
|
type DxGridPosition,
|
|
9
10
|
type DxGridPointer,
|
|
@@ -14,15 +15,15 @@ import {
|
|
|
14
15
|
type DxGridFrozenColsPlane,
|
|
15
16
|
type DxGridFrozenPlane,
|
|
16
17
|
type DxGridAxis,
|
|
18
|
+
type DxGridPlanePosition,
|
|
19
|
+
separator,
|
|
17
20
|
} from './types';
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
export const separator = ',';
|
|
22
|
+
export const toPlaneCellIndex = (cellCoords: Partial<DxGridPosition> & DxGridPlanePosition): DxGridPlaneCellIndex =>
|
|
23
|
+
`${cellCoords.col}${separator}${cellCoords.row}`;
|
|
23
24
|
|
|
24
25
|
export const toCellIndex = (cellCoords: DxGridPosition): DxGridCellIndex =>
|
|
25
|
-
`${cellCoords.col}${separator}${cellCoords.row}`;
|
|
26
|
+
`${cellCoords.plane}${separator}${cellCoords.col}${separator}${cellCoords.row}`;
|
|
26
27
|
|
|
27
28
|
//
|
|
28
29
|
// A1 notation is the fallback for numbering columns and rows.
|