@dxos/lit-grid 0.8.4-main.84f28bd → 0.8.4-main.8baae0fced

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 (48) hide show
  1. package/LICENSE +102 -5
  2. package/dist/src/defs.d.ts +1 -0
  3. package/dist/src/defs.d.ts.map +1 -1
  4. package/dist/src/defs.js +1 -0
  5. package/dist/src/defs.js.map +1 -1
  6. package/dist/src/dx-grid-axis-resize-handle.d.ts.map +1 -1
  7. package/dist/src/dx-grid-axis-resize-handle.js +3 -5
  8. package/dist/src/dx-grid-axis-resize-handle.js.map +1 -1
  9. package/dist/src/dx-grid-multiselect-cell.d.ts.map +1 -1
  10. package/dist/src/dx-grid-multiselect-cell.js +2 -1
  11. package/dist/src/dx-grid-multiselect-cell.js.map +1 -1
  12. package/dist/src/dx-grid.d.ts +14 -9
  13. package/dist/src/dx-grid.d.ts.map +1 -1
  14. package/dist/src/dx-grid.js +207 -170
  15. package/dist/src/dx-grid.js.map +1 -1
  16. package/dist/src/dx-grid.lit-stories.d.ts +12 -15
  17. package/dist/src/dx-grid.lit-stories.d.ts.map +1 -1
  18. package/dist/src/dx-grid.lit-stories.js +20 -23
  19. package/dist/src/dx-grid.lit-stories.js.map +1 -1
  20. package/dist/src/playwright/dx-grid.spec.js +7 -6
  21. package/dist/src/playwright/dx-grid.spec.js.map +1 -1
  22. package/dist/src/playwright/playwright.config.d.ts.map +1 -1
  23. package/dist/src/playwright/playwright.config.js +1 -1
  24. package/dist/src/playwright/playwright.config.js.map +1 -1
  25. package/dist/src/testing/dx-grid-manager.d.ts.map +1 -1
  26. package/dist/src/testing/dx-grid-manager.js.map +1 -1
  27. package/dist/src/types.d.ts +10 -1
  28. package/dist/src/types.d.ts.map +1 -1
  29. package/dist/src/types.js.map +1 -1
  30. package/dist/src/util.d.ts +12 -7
  31. package/dist/src/util.d.ts.map +1 -1
  32. package/dist/src/util.js +15 -13
  33. package/dist/src/util.js.map +1 -1
  34. package/dist/tsconfig.tsbuildinfo +1 -1
  35. package/package.json +17 -14
  36. package/src/defs.ts +1 -0
  37. package/src/dx-grid-axis-resize-handle.pcss +9 -3
  38. package/src/dx-grid-axis-resize-handle.ts +1 -1
  39. package/src/dx-grid-multiselect-cell.pcss +7 -5
  40. package/src/dx-grid-multiselect-cell.ts +2 -1
  41. package/src/dx-grid.lit-stories.ts +3 -5
  42. package/src/dx-grid.pcss +86 -44
  43. package/src/dx-grid.ts +203 -118
  44. package/src/playwright/dx-grid.spec.ts +8 -7
  45. package/src/playwright/playwright.config.ts +1 -1
  46. package/src/testing/dx-grid-manager.ts +1 -1
  47. package/src/types.ts +11 -0
  48. package/src/util.ts +17 -11
package/src/types.ts CHANGED
@@ -83,6 +83,10 @@ export type DxGridCellValue = {
83
83
  * Controls the read-only state of the cell.
84
84
  */
85
85
  readonly?: DxGridReadonlyValue;
86
+ /**
87
+ * Controls whether the cell content should unfurl when the cell has focus.
88
+ */
89
+ focusUnfurl?: boolean;
86
90
  };
87
91
 
88
92
  export type DxGridAxisMetaProps = {
@@ -90,6 +94,9 @@ export type DxGridAxisMetaProps = {
90
94
  description?: string;
91
95
  resizeable?: boolean;
92
96
  readonly?: DxGridReadonlyValue;
97
+ focusUnfurl?: boolean;
98
+ minSize?: number;
99
+ maxSize?: number;
93
100
  };
94
101
 
95
102
  export type DxGridAxisSizes = DxGridPlaneRecord<DxGridFrozenPlane, Record<string, number>>;
@@ -121,6 +128,10 @@ export type DxGridSelectionProps = {
121
128
  visible?: boolean;
122
129
  };
123
130
 
131
+ export type DxGridFocusIndicatorVariant = 'sheet' | 'stack';
132
+
133
+ export type DxGridOverscroll = 'inline' | 'block' | 'trap' | undefined;
134
+
124
135
  export class DxAxisResize extends Event {
125
136
  public readonly axis: DxGridAxis;
126
137
  public readonly plane: 'grid' | DxGridFrozenPlane;
package/src/util.ts CHANGED
@@ -4,19 +4,19 @@
4
4
 
5
5
  import { defaultRowSize } from './defs';
6
6
  import {
7
- type DxGridPlaneCellIndex,
7
+ type DxGridAxis,
8
8
  type DxGridCellIndex,
9
- type DxGridPosition,
10
- type DxGridPointer,
11
- type DxGridSelectionProps,
12
- type DxGridPositionNullable,
13
- type DxGridPlane,
14
- type DxGridFrozenRowsPlane,
15
9
  type DxGridFrozenColsPlane,
16
10
  type DxGridFrozenPlane,
17
- type DxGridAxis,
11
+ type DxGridFrozenRowsPlane,
12
+ type DxGridPlane,
13
+ type DxGridPlaneCellIndex,
18
14
  type DxGridPlanePosition,
15
+ type DxGridPointer,
16
+ type DxGridPosition,
17
+ type DxGridPositionNullable,
19
18
  type DxGridReadonlyValue,
19
+ type DxGridSelectionProps,
20
20
  separator,
21
21
  } from './types';
22
22
 
@@ -25,7 +25,7 @@ export const toPlaneCellIndex = (cellCoords: Partial<DxGridPosition> & DxGridPla
25
25
 
26
26
  export function parseCellIndex(index: DxGridCellIndex): DxGridPosition;
27
27
  export function parseCellIndex(index: DxGridPlaneCellIndex): DxGridPlanePosition;
28
- // eslint-disable-next-line @stayradiated/prefer-arrow-functions/prefer-arrow-functions
28
+
29
29
  export function parseCellIndex(index: DxGridPlaneCellIndex | DxGridCellIndex): DxGridPlanePosition | DxGridPosition {
30
30
  const coords = index.split(separator);
31
31
  if (coords.length === 3) {
@@ -63,9 +63,11 @@ export const rowToA1Notation = (row: number): string => {
63
63
  };
64
64
 
65
65
  /**
66
- * The size in pixels of the gap between cells
66
+ * The size in pixels of the gap between cells.
67
+ * Must match `--dx-grid-gap` / `--dx-plane-gap` in `dx-grid.pcss`. Cells
68
+ * paint their own borders edge-to-edge, so this is 0.
67
69
  */
68
- export const gap = 1;
70
+ export const gap = 0;
69
71
 
70
72
  /**
71
73
  * ResizeObserver notices even subpixel changes, only respond to changes of at least 1px.
@@ -123,6 +125,10 @@ export const closestAction = (target: EventTarget | null): { action: string | nu
123
125
  return { actionEl, action: actionEl?.getAttribute('data-dx-grid-action') ?? null };
124
126
  };
125
127
 
128
+ export const accessoryHandlesPointerdownAttrs = {
129
+ 'data-dx-grid-action': 'accessory',
130
+ };
131
+
126
132
  export const closestCell = (target: EventTarget | null, actionEl?: HTMLElement | null): DxGridPositionNullable => {
127
133
  let cellElement = actionEl;
128
134
  if (!cellElement) {