@1771technologies/lytenyte-pro 1.0.0-beta.2 → 1.0.0-beta.20

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 (152) hide show
  1. package/dist/+types.d.ts +40 -11
  2. package/dist/cell-selection/adjust-rect-for-row-and-cell-span.d.ts +1 -1
  3. package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +1 -1
  4. package/dist/cell-selection/are-rects-equal.d.ts +1 -1
  5. package/dist/cell-selection/bound-selection-rect.d.ts +1 -1
  6. package/dist/cell-selection/cell-selection-driver.js +9 -1
  7. package/dist/cell-selection/deselect-rect-range.d.ts +1 -1
  8. package/dist/cell-selection/deselect-rect-range.js +1 -1
  9. package/dist/cell-selection/expand-cell-selection-down.d.ts +2 -2
  10. package/dist/cell-selection/expand-cell-selection-down.js +1 -1
  11. package/dist/cell-selection/expand-cell-selection-end.d.ts +2 -2
  12. package/dist/cell-selection/expand-cell-selection-end.js +1 -1
  13. package/dist/cell-selection/expand-cell-selection-start.d.ts +2 -2
  14. package/dist/cell-selection/expand-cell-selection-start.js +1 -1
  15. package/dist/cell-selection/expand-cell-selection-up.d.ts +2 -2
  16. package/dist/cell-selection/expand-cell-selection-up.js +1 -1
  17. package/dist/cell-selection/full-width-start-end-index.d.ts +1 -1
  18. package/dist/cell-selection/get-root-cell.d.ts +1 -1
  19. package/dist/cell-selection/get-root-cell.js +2 -2
  20. package/dist/cell-selection/is-bottom-rect.d.ts +1 -1
  21. package/dist/cell-selection/is-center-col-rect.d.ts +1 -1
  22. package/dist/cell-selection/is-center-rect.d.ts +1 -1
  23. package/dist/cell-selection/is-end-rect.d.ts +1 -1
  24. package/dist/cell-selection/is-overlapping-rect.d.ts +1 -1
  25. package/dist/cell-selection/is-start-rect.d.ts +1 -1
  26. package/dist/cell-selection/is-top-rect.d.ts +1 -1
  27. package/dist/cell-selection/is-within-selection-rect.d.ts +1 -1
  28. package/dist/cell-selection/split-cell-selection-rect.d.ts +1 -1
  29. package/dist/cell-selection/update-additive-cell-selection.d.ts +2 -2
  30. package/dist/cell-selection/update-additive-cell-selection.js +4 -6
  31. package/dist/cell-selection/use-edge-scroll.d.ts +2 -2
  32. package/dist/cells/cell.js +3 -2
  33. package/dist/column-manager/branch.js +19 -3
  34. package/dist/column-manager/label.d.ts +1 -1
  35. package/dist/column-manager/label.js +2 -2
  36. package/dist/column-manager/leaf.js +21 -3
  37. package/dist/column-manager/move-handle.d.ts +1 -1
  38. package/dist/column-manager/move-handle.js +2 -2
  39. package/dist/column-manager/root.js +1 -1
  40. package/dist/column-manager/use-column-manager.d.ts +7 -3
  41. package/dist/column-manager/use-column-manager.js +3 -3
  42. package/dist/column-manager/use-columns-from-context.d.ts +2 -2
  43. package/dist/column-manager/use-columns-from-context.js +1 -1
  44. package/dist/column-manager/visibility-checkbox.d.ts +1 -1
  45. package/dist/column-manager/visibility-checkbox.js +2 -2
  46. package/dist/filter-tree/filter-tree.d.ts +7 -7
  47. package/dist/filter-tree/filter-tree.js +8 -8
  48. package/dist/filter-tree/hooks/use-tree-item.d.ts +2 -2
  49. package/dist/filter-tree/hooks/use-tree-item.js +2 -2
  50. package/dist/filter-tree/inclusion-checkbox.d.ts +1 -1
  51. package/dist/filter-tree/inclusion-checkbox.js +2 -2
  52. package/dist/filter-tree/label.d.ts +1 -1
  53. package/dist/filter-tree/label.js +2 -2
  54. package/dist/filter-tree/root.d.ts +3 -3
  55. package/dist/filter-tree/root.js +3 -3
  56. package/dist/grid-box/+types.d.ts +5 -3
  57. package/dist/grid-box/context.d.ts +1 -1
  58. package/dist/grid-box/item.d.ts +4 -1
  59. package/dist/grid-box/item.js +39 -9
  60. package/dist/grid-box/use-aggregation-box-items.d.ts +2 -2
  61. package/dist/grid-box/use-aggregation-box-items.js +3 -1
  62. package/dist/grid-box/use-column-box-items.d.ts +8 -4
  63. package/dist/grid-box/use-column-box-items.js +11 -14
  64. package/dist/grid-box/use-row-group-box-items.d.ts +4 -4
  65. package/dist/grid-box/use-row-group-box-items.js +14 -15
  66. package/dist/grid-provider/context.d.ts +2 -2
  67. package/dist/grid-provider/provider.d.ts +2 -2
  68. package/dist/grid-provider/provider.js +1 -1
  69. package/dist/grid-provider/use-grid.d.ts +2 -2
  70. package/dist/grid-provider/use-grid.js +1 -1
  71. package/dist/grid.d.ts +1 -12
  72. package/dist/grid.js +2 -12
  73. package/dist/header/header-cell.d.ts +1 -1
  74. package/dist/header/header-cell.js +2 -2
  75. package/dist/header/resize-handler.d.ts +2 -2
  76. package/dist/header/resize-handler.js +8 -3
  77. package/dist/header/use-drag-move.d.ts +2 -2
  78. package/dist/header/use-drag-move.js +9 -2
  79. package/dist/header/use-header-cell-renderer.js +3 -3
  80. package/dist/icons/index.d.ts +1 -0
  81. package/dist/icons/index.js +1 -0
  82. package/dist/index.d.ts +5 -0
  83. package/dist/index.js +5 -0
  84. package/dist/listbox/item.js +1 -1
  85. package/dist/row-data-source-client/built-ins/built-ins.d.ts +1 -1
  86. package/dist/row-data-source-client/built-ins/built-ins.js +1 -1
  87. package/dist/row-data-source-client/filter/compute-filtered-rows.js +1 -1
  88. package/dist/row-data-source-client/pivots/create-pivot-columns.js +2 -2
  89. package/dist/row-data-source-client/tree/evaluator-aggregation.d.ts +1 -1
  90. package/dist/row-data-source-client/tree/evaluator-group.d.ts +1 -1
  91. package/dist/row-data-source-client/tree/traverse.d.ts +1 -1
  92. package/dist/row-data-source-client/tree/traverse.js +1 -1
  93. package/dist/row-data-source-client/use-client-data-source-paginated.d.ts +2 -2
  94. package/dist/row-data-source-client/use-client-data-source-paginated.js +54 -25
  95. package/dist/row-data-source-client/use-client-data-source.d.ts +2 -2
  96. package/dist/row-data-source-client/use-client-data-source.js +56 -27
  97. package/dist/row-data-source-client/use-client-tree-data-source.d.ts +1 -1
  98. package/dist/row-data-source-client/use-client-tree-data-source.js +54 -25
  99. package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.js +1 -1
  100. package/dist/row-data-source-server/async-tree/make-async-tree.js +3 -3
  101. package/dist/row-data-source-server/use-server-data-source.d.ts +1 -1
  102. package/dist/row-data-source-server/use-server-data-source.js +8 -5
  103. package/dist/sort-manager/context.d.ts +3 -3
  104. package/dist/sort-manager/hooks/use-sort-manager.d.ts +2 -2
  105. package/dist/sort-manager/hooks/use-sort-manager.js +2 -2
  106. package/dist/sort-manager/hooks/use-sort-row-item.d.ts +1 -1
  107. package/dist/sort-manager/hooks/use-sort-row-item.js +1 -1
  108. package/dist/sort-manager/sort-add.d.ts +1 -1
  109. package/dist/sort-manager/sort-add.js +3 -3
  110. package/dist/sort-manager/sort-apply.d.ts +1 -1
  111. package/dist/sort-manager/sort-apply.js +3 -3
  112. package/dist/sort-manager/sort-cancel.d.ts +1 -1
  113. package/dist/sort-manager/sort-cancel.js +3 -3
  114. package/dist/sort-manager/sort-clear.d.ts +1 -1
  115. package/dist/sort-manager/sort-clear.js +3 -3
  116. package/dist/sort-manager/sort-column-select.d.ts +1 -1
  117. package/dist/sort-manager/sort-column-select.js +2 -2
  118. package/dist/sort-manager/sort-direction-select.d.ts +1 -1
  119. package/dist/sort-manager/sort-direction-select.js +2 -2
  120. package/dist/sort-manager/sort-remove.d.ts +1 -1
  121. package/dist/sort-manager/sort-remove.js +3 -3
  122. package/dist/sort-manager/sort-value-select.d.ts +1 -1
  123. package/dist/sort-manager/sort-value-select.js +2 -2
  124. package/dist/sort-manager/utils/sort-item-to-sort-model.d.ts +1 -1
  125. package/dist/sort-manager/utils/sort-model-to-sort-items.d.ts +1 -1
  126. package/dist/state/+types.d.ts +2 -1
  127. package/dist/state/api/column-autosize.d.ts +1 -1
  128. package/dist/state/api/column-autosize.js +2 -2
  129. package/dist/state/api/column-move.js +1 -1
  130. package/dist/state/api/column-update.d.ts +4 -1
  131. package/dist/state/api/column-update.js +13 -0
  132. package/dist/state/api/dialog-frame.d.ts +1 -1
  133. package/dist/state/api/edit-begin.d.ts +1 -1
  134. package/dist/state/api/edit-begin.js +1 -1
  135. package/dist/state/api/edit-end.d.ts +1 -1
  136. package/dist/state/api/edit-is-cell-active.d.ts +1 -1
  137. package/dist/state/api/edit-update.d.ts +1 -1
  138. package/dist/state/api/edit-update.js +1 -1
  139. package/dist/state/api/export-csv.js +1 -1
  140. package/dist/state/api/export-data-rect.js +1 -1
  141. package/dist/state/api/focus-cell.d.ts +1 -1
  142. package/dist/state/api/popover-frame.d.ts +2 -2
  143. package/dist/state/api/row-detail-rendered-height.d.ts +2 -2
  144. package/dist/state/helpers/column-add-row-group.d.ts +2 -1
  145. package/dist/state/helpers/column-add-row-group.js +9 -1
  146. package/dist/state/helpers/column-marker.js +1 -1
  147. package/dist/state/helpers/empty-row-data-source.js +1 -0
  148. package/dist/state/helpers/resolve-column.d.ts +1 -1
  149. package/dist/state/helpers/resolve-column.js +7 -0
  150. package/dist/state/use-lytenyte.js +5 -0
  151. package/dist/tree-view/leaf.js +1 -0
  152. package/package.json +12 -6
@@ -1,4 +1,4 @@
1
- import { getDataRect } from "../helpers/get-data-rect";
1
+ import { getDataRect } from "../helpers/get-data-rect.js";
2
2
  export const makeExportCsv = (grid) => {
3
3
  return async (p) => {
4
4
  const visible = grid.state.columnMeta.get().columnsVisible;
@@ -1,4 +1,4 @@
1
- import { getDataRect } from "../helpers/get-data-rect";
1
+ import { getDataRect } from "../helpers/get-data-rect.js";
2
2
  export const makeExportDataRect = (grid) => {
3
3
  return (p) => {
4
4
  const s = grid.state;
@@ -1,5 +1,5 @@
1
1
  import type { Grid, GridApi } from "../../+types";
2
- import type { InternalAtoms } from "../+types";
2
+ import type { InternalAtoms } from "../+types.js";
3
3
  export declare const makeFocusCell: (grid: Grid<any> & {
4
4
  internal: InternalAtoms;
5
5
  }) => GridApi<any>["focusCell"];
@@ -1,5 +1,5 @@
1
- import type { InternalAtoms } from "../+types";
2
- import type { Grid, GridApi } from "../../+types";
1
+ import type { InternalAtoms } from "../+types.js";
2
+ import type { Grid, GridApi } from "../../+types.js";
3
3
  export declare const makePopoverFrameOpen: (grid: Grid<any> & {
4
4
  internal: InternalAtoms;
5
5
  }) => GridApi<any>["popoverFrameOpen"];
@@ -1,5 +1,5 @@
1
- import type { InternalAtoms } from "../+types";
2
- import type { Grid, GridApi } from "../../+types";
1
+ import type { InternalAtoms } from "../+types.js";
2
+ import type { Grid, GridApi } from "../../+types.js";
3
3
  export declare const makeRowDetailRenderedHeight: (grid: Grid<any> & {
4
4
  internal: InternalAtoms;
5
5
  }) => GridApi<any>["rowDetailRenderedHeight"];
@@ -4,6 +4,7 @@ interface ColumnHandleGroupColumnArgs<T> {
4
4
  readonly rowGroupTemplate: RowGroupColumn<T>;
5
5
  readonly rowGroupModel: RowGroupModelItem<T>[];
6
6
  readonly rowGroupDisplayMode: RowGroupDisplayMode;
7
+ readonly rowGroupColumnState: Record<string, Partial<Column<T>>>;
7
8
  }
8
- export declare function columnAddRowGroup<T>({ columns, rowGroupModel, rowGroupDisplayMode, rowGroupTemplate, }: ColumnHandleGroupColumnArgs<T>): Column<T>[];
9
+ export declare function columnAddRowGroup<T>({ columns, rowGroupModel, rowGroupDisplayMode, rowGroupTemplate, rowGroupColumnState, }: ColumnHandleGroupColumnArgs<T>): Column<T>[];
9
10
  export {};
@@ -10,7 +10,7 @@ const baseGroup = {
10
10
  return d.data.key;
11
11
  },
12
12
  };
13
- export function columnAddRowGroup({ columns, rowGroupModel, rowGroupDisplayMode, rowGroupTemplate, }) {
13
+ export function columnAddRowGroup({ columns, rowGroupModel, rowGroupDisplayMode, rowGroupTemplate, rowGroupColumnState, }) {
14
14
  const lookup = itemsWithIdToMap(columns);
15
15
  rowGroupModel.forEach((c) => {
16
16
  if (typeof c === "string")
@@ -62,5 +62,13 @@ export function columnAddRowGroup({ columns, rowGroupModel, rowGroupDisplayMode,
62
62
  }
63
63
  if (!hasGroupColumn)
64
64
  columns = columns.filter((c) => !c.id.startsWith(GROUP_COLUMN_PREFIX));
65
+ // TODO: this can be improved - what if the columns are really large?
66
+ const keys = Object.keys(rowGroupColumnState);
67
+ for (let i = 0; i < keys.length; i++) {
68
+ const column = columns.find((c) => c.id === keys[i]);
69
+ if (!column)
70
+ continue;
71
+ Object.assign(column, rowGroupColumnState[keys[i]]);
72
+ }
65
73
  return columns;
66
74
  }
@@ -13,7 +13,7 @@ export function columnHandleMarker({ columns, marker, markerEnabled, }) {
13
13
  widthMin: 24,
14
14
  cellRenderer: marker.cellRenderer,
15
15
  headerRenderer: marker.headerRenderer ?? HeaderRenderer,
16
- floatingRenderer: marker.floatingRenderer ?? FloatingRenderer,
16
+ floatingCellRenderer: marker.floatingCellRenderer ?? FloatingRenderer,
17
17
  uiHints: marker.uiHints,
18
18
  },
19
19
  ...columns,
@@ -11,6 +11,7 @@ export const emptyRowDataSource = {
11
11
  rowAdd: () => { },
12
12
  rowDelete: () => { },
13
13
  rowSetBotData: () => { },
14
+ rowSetCenterData: () => { },
14
15
  rowSetTopData: () => { },
15
16
  rowAreAllSelected: () => false,
16
17
  inFilterItems: () => [],
@@ -1,4 +1,4 @@
1
1
  import type { Column, ColumnMeta } from "../../+types";
2
2
  export declare function resolveColumn(c: string | number | Column<any>, errorRef: {
3
3
  current: boolean;
4
- }, meta: ColumnMeta<any>): string | undefined;
4
+ }, meta: ColumnMeta<any>): string | Column<any> | undefined;
@@ -1,5 +1,9 @@
1
+ import { GROUP_COLUMN_PREFIX } from "@1771technologies/lytenyte-shared";
1
2
  export function resolveColumn(c, errorRef, meta) {
2
3
  if (typeof c === "string") {
4
+ if (c.startsWith(GROUP_COLUMN_PREFIX)) {
5
+ return meta.columnsVisible.find((x) => x.id === c);
6
+ }
3
7
  if (!meta.columnLookup.has(c)) {
4
8
  errorRef.current = true;
5
9
  console.error(`Invalid column ${c}`);
@@ -14,6 +18,9 @@ export function resolveColumn(c, errorRef, meta) {
14
18
  }
15
19
  return col?.id;
16
20
  }
21
+ if (c.id.startsWith(GROUP_COLUMN_PREFIX)) {
22
+ return meta.columnsVisible.find((x) => x.id === c.id);
23
+ }
17
24
  if (!meta.columnLookup.has(c.id)) {
18
25
  errorRef.current = true;
19
26
  console.error(`Invalid column ${c.id}`);
@@ -132,6 +132,7 @@ export function makeLyteNyte(p) {
132
132
  const columnPivotRowGroupExpansions = atom({});
133
133
  const cellSelections = atom(p.cellSelections ?? []);
134
134
  const cellSelectionMode = atom(p.cellSelectionMode ?? "none");
135
+ const internal__rowGroupColumnState = atom({});
135
136
  const internal_cellSelectionPivot = atom(null);
136
137
  const internal_cellSelectionAdditive = atom(null);
137
138
  const internal_cellSelectionSplits = atom((g) => {
@@ -220,6 +221,7 @@ export function makeLyteNyte(p) {
220
221
  * is impacted by the column definitions, the group expansions, the row group display mode.
221
222
  */
222
223
  const columnView = atom((g) => {
224
+ const groupState = g(internal__rowGroupColumnState);
223
225
  const pivotMode = g(columnPivotMode);
224
226
  let cols;
225
227
  if (pivotMode) {
@@ -229,6 +231,7 @@ export function makeLyteNyte(p) {
229
231
  rowGroupDisplayMode: "single-column",
230
232
  rowGroupModel: model.rows.filter((c) => c.active ?? true).map((c) => c.field),
231
233
  rowGroupTemplate: g(rowGroupColumn),
234
+ rowGroupColumnState: groupState,
232
235
  });
233
236
  }
234
237
  else {
@@ -237,6 +240,7 @@ export function makeLyteNyte(p) {
237
240
  rowGroupDisplayMode: g(rowGroupDisplayMode),
238
241
  rowGroupModel: g(rowGroupModel),
239
242
  rowGroupTemplate: g(rowGroupColumn),
243
+ rowGroupColumnState: groupState,
240
244
  });
241
245
  }
242
246
  const colsWithMarker = columnHandleMarker({
@@ -543,6 +547,7 @@ export function makeLyteNyte(p) {
543
547
  cellSelectionAdditiveRects: makeGridAtom(internal_cellSelectionAdditive, store),
544
548
  cellSelectionIsDeselect: makeGridAtom(atom(false), store),
545
549
  cellSelectionSplits: makeGridAtom(internal_cellSelectionSplits, store),
550
+ rowGroupColumnState: makeGridAtom(internal__rowGroupColumnState, store),
546
551
  store: store,
547
552
  },
548
553
  });
@@ -13,6 +13,7 @@ export const TreeLeaf = forwardRef(function TreeLeaf({ itemId, ...props }, forwa
13
13
  e.ctrlKey ||
14
14
  e.shiftKey)
15
15
  return;
16
+ e.preventDefault();
16
17
  const nodes = getFocusables(e.currentTarget);
17
18
  const index = nodes.indexOf(document.activeElement);
18
19
  if (index === -1) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@1771technologies/lytenyte-pro",
3
3
  "description": "Blazingly fast headless React data grid with 100s of features.",
4
- "version": "1.0.0-beta.2",
4
+ "version": "1.0.0-beta.20",
5
5
  "type": "module",
6
6
  "license": "COMMERCIAL",
7
7
  "files": [
@@ -32,6 +32,11 @@
32
32
  "import": "./dist/index.js",
33
33
  "require": "./dist/index.js"
34
34
  },
35
+ "./icons": {
36
+ "types": "./dist/icons/index.d.ts",
37
+ "import": "./dist/icons/index.js",
38
+ "require": "./dist/icons/index.js"
39
+ },
35
40
  "./types": {
36
41
  "types": "./dist/+types.d.ts",
37
42
  "import": "./dist/+types.js",
@@ -44,11 +49,12 @@
44
49
  },
45
50
  "dependencies": {
46
51
  "@1771technologies/atom": "^1.0.2",
47
- "@1771technologies/lytenyte-shared": "1.0.0-beta.2",
48
- "@1771technologies/lytenyte-js-utils": "1.0.0-beta.2",
49
- "@1771technologies/lytenyte-react-hooks": "1.0.0-beta.2",
50
- "@1771technologies/lytenyte-dragon": "1.0.0-beta.2",
51
- "@1771technologies/lytenyte-dom-utils": "1.0.0-beta.2"
52
+ "@1771technologies/lytenyte-core": "1.0.0-beta.20",
53
+ "@1771technologies/lytenyte-dom-utils": "1.0.0-beta.20",
54
+ "@1771technologies/lytenyte-js-utils": "1.0.0-beta.20",
55
+ "@1771technologies/lytenyte-dragon": "1.0.0-beta.20",
56
+ "@1771technologies/lytenyte-react-hooks": "1.0.0-beta.20",
57
+ "@1771technologies/lytenyte-shared": "1.0.0-beta.20"
52
58
  },
53
59
  "peerDependencies": {
54
60
  "react": "^18.0.0 || ^19.0.0",