@dxos/lit-grid 0.7.1 → 0.7.2-staging.6d26b2a

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.
Files changed (73) hide show
  1. package/dist/src/dx-grid.d.ts +2 -0
  2. package/dist/src/dx-grid.d.ts.map +1 -1
  3. package/dist/src/dx-grid.js +37 -5
  4. package/dist/src/dx-grid.js.map +1 -1
  5. package/dist/src/dx-grid.lit-stories.d.ts +4 -1
  6. package/dist/src/dx-grid.lit-stories.d.ts.map +1 -1
  7. package/dist/src/dx-grid.lit-stories.js +14 -12
  8. package/dist/src/dx-grid.lit-stories.js.map +1 -1
  9. package/dist/src/testing/index.d.ts +2 -0
  10. package/dist/src/testing/index.d.ts.map +1 -0
  11. package/dist/src/testing/index.js +5 -0
  12. package/dist/src/testing/index.js.map +1 -0
  13. package/dist/src/testing/playwright/dx-grid-manager.d.ts +23 -0
  14. package/dist/src/testing/playwright/dx-grid-manager.d.ts.map +1 -0
  15. package/dist/src/testing/playwright/dx-grid-manager.js +76 -0
  16. package/dist/src/testing/playwright/dx-grid-manager.js.map +1 -0
  17. package/dist/src/testing/playwright/dx-grid.spec.d.ts +2 -0
  18. package/dist/src/testing/playwright/dx-grid.spec.d.ts.map +1 -0
  19. package/dist/src/testing/playwright/dx-grid.spec.js +92 -0
  20. package/dist/src/testing/playwright/dx-grid.spec.js.map +1 -0
  21. package/dist/src/testing/playwright/playwright.config.d.ts +3 -0
  22. package/dist/src/testing/playwright/playwright.config.d.ts.map +1 -0
  23. package/dist/src/testing/playwright/playwright.config.js +16 -0
  24. package/dist/src/testing/playwright/playwright.config.js.map +1 -0
  25. package/dist/src/types.d.ts +5 -3
  26. package/dist/src/types.d.ts.map +1 -1
  27. package/dist/src/types.js +4 -3
  28. package/dist/src/types.js.map +1 -1
  29. package/dist/src/util.d.ts +2 -5
  30. package/dist/src/util.d.ts.map +1 -1
  31. package/dist/src/util.js +3 -5
  32. package/dist/src/util.js.map +1 -1
  33. package/dist/types/src/dx-grid.d.ts +2 -0
  34. package/dist/types/src/dx-grid.d.ts.map +1 -1
  35. package/dist/types/src/dx-grid.js +37 -5
  36. package/dist/types/src/dx-grid.js.map +1 -1
  37. package/dist/types/src/dx-grid.lit-stories.d.ts +4 -1
  38. package/dist/types/src/dx-grid.lit-stories.d.ts.map +1 -1
  39. package/dist/types/src/dx-grid.lit-stories.js +14 -12
  40. package/dist/types/src/dx-grid.lit-stories.js.map +1 -1
  41. package/dist/types/src/testing/index.d.ts +2 -0
  42. package/dist/types/src/testing/index.d.ts.map +1 -0
  43. package/dist/types/src/testing/index.js +5 -0
  44. package/dist/types/src/testing/index.js.map +1 -0
  45. package/dist/types/src/testing/playwright/dx-grid-manager.d.ts +23 -0
  46. package/dist/types/src/testing/playwright/dx-grid-manager.d.ts.map +1 -0
  47. package/dist/types/src/testing/playwright/dx-grid-manager.js +76 -0
  48. package/dist/types/src/testing/playwright/dx-grid-manager.js.map +1 -0
  49. package/dist/types/src/testing/playwright/dx-grid.spec.d.ts +2 -0
  50. package/dist/types/src/testing/playwright/dx-grid.spec.d.ts.map +1 -0
  51. package/dist/types/src/testing/playwright/dx-grid.spec.js +92 -0
  52. package/dist/types/src/testing/playwright/dx-grid.spec.js.map +1 -0
  53. package/dist/types/src/testing/playwright/playwright.config.d.ts +3 -0
  54. package/dist/types/src/testing/playwright/playwright.config.d.ts.map +1 -0
  55. package/dist/types/src/testing/playwright/playwright.config.js +16 -0
  56. package/dist/types/src/testing/playwright/playwright.config.js.map +1 -0
  57. package/dist/types/src/types.d.ts +5 -3
  58. package/dist/types/src/types.d.ts.map +1 -1
  59. package/dist/types/src/types.js +4 -3
  60. package/dist/types/src/types.js.map +1 -1
  61. package/dist/types/src/util.d.ts +2 -5
  62. package/dist/types/src/util.d.ts.map +1 -1
  63. package/dist/types/src/util.js +3 -5
  64. package/dist/types/src/util.js.map +1 -1
  65. package/package.json +19 -3
  66. package/src/dx-grid.lit-stories.ts +14 -12
  67. package/src/dx-grid.ts +43 -7
  68. package/src/testing/index.ts +5 -0
  69. package/src/testing/playwright/dx-grid-manager.ts +106 -0
  70. package/src/testing/playwright/dx-grid.spec.ts +118 -0
  71. package/src/testing/playwright/playwright.config.ts +18 -0
  72. package/src/types.ts +9 -6
  73. 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 { toCellIndex } from './util';
6
+ import { toPlaneCellIndex } from './util';
7
7
 
8
- export type DxGridCellIndex = `${string},${string}`;
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<DxGridCellIndex, DxGridCellValue>;
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: DxGridCellIndex;
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 = toCellIndex(start);
178
- this.end = toCellIndex(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
- * Separator for serializing cell position vectors
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.