@1771technologies/lytenyte-pro 1.0.7 → 1.0.9

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 (90) hide show
  1. package/dist/cell-selection/cell-selection-containers.js +5 -5
  2. package/dist/cell-selection/cell-selection-driver.js +9 -9
  3. package/dist/cell-selection/cell-style-row.js +1 -1
  4. package/dist/cell-selection/split-on-pivot.js +1 -1
  5. package/dist/cells/+types.cell.d.ts +13 -0
  6. package/dist/cells/+types.cell.js +1 -0
  7. package/dist/cells/cell-editor.js +2 -2
  8. package/dist/cells/cell-spacer.d.ts +9 -3
  9. package/dist/cells/cell-spacer.js +10 -13
  10. package/dist/cells/cell.js +20 -17
  11. package/dist/cells/use-cell-style.d.ts +3 -0
  12. package/dist/cells/use-cell-style.js +51 -0
  13. package/dist/column-manager/branch.js +4 -4
  14. package/dist/column-manager/column-manager.d.ts +7 -7
  15. package/dist/column-manager/column-manager.js +8 -8
  16. package/dist/column-manager/label.js +1 -1
  17. package/dist/column-manager/leaf.js +4 -4
  18. package/dist/column-manager/move-handle.js +3 -3
  19. package/dist/column-manager/panel.js +1 -1
  20. package/dist/column-manager/root.js +3 -3
  21. package/dist/column-manager/use-column-manager.js +1 -1
  22. package/dist/column-manager/visibility-checkbox.js +3 -3
  23. package/dist/filter-tree/branch.js +3 -3
  24. package/dist/filter-tree/context.d.ts +2 -2
  25. package/dist/filter-tree/hooks/use-filter-tree.js +1 -1
  26. package/dist/filter-tree/inclusion-checkbox.js +1 -1
  27. package/dist/filter-tree/label.js +1 -1
  28. package/dist/filter-tree/leaf.js +3 -3
  29. package/dist/filter-tree/root.js +3 -3
  30. package/dist/grid-box/grid-box.d.ts +5 -5
  31. package/dist/grid-box/grid-box.js +6 -6
  32. package/dist/grid-box/item.js +2 -2
  33. package/dist/grid-box/panel.js +2 -2
  34. package/dist/grid-box/root.d.ts +1 -1
  35. package/dist/grid-box/root.js +3 -3
  36. package/dist/grid.d.ts +8 -8
  37. package/dist/grid.js +12 -12
  38. package/dist/header/header-cell.js +4 -4
  39. package/dist/header/header-group-cell.js +2 -2
  40. package/dist/header/header-row.js +1 -1
  41. package/dist/header/header.js +1 -1
  42. package/dist/header/resize-handler.js +1 -1
  43. package/dist/header/use-header-cell-renderer.js +1 -1
  44. package/dist/icons/index.js +3 -1
  45. package/dist/index.d.ts +4 -4
  46. package/dist/index.js +4 -4
  47. package/dist/listbox/item.js +1 -1
  48. package/dist/listbox/panel.js +1 -1
  49. package/dist/listbox/root.js +1 -1
  50. package/dist/root/dialog-driver.js +1 -1
  51. package/dist/root/popover-driver.js +1 -1
  52. package/dist/root/root.js +5 -5
  53. package/dist/row-data-source-client/pivots/create-agg-model.d.ts +2 -2
  54. package/dist/row-data-source-client/pivots/create-agg-model.js +1 -1
  55. package/dist/row-data-source-client/use-client-data-source-paginated.js +2 -0
  56. package/dist/row-data-source-client/use-client-data-source.js +2 -0
  57. package/dist/row-data-source-client/use-client-tree-data-source.js +2 -0
  58. package/dist/rows/row/context.d.ts +8 -0
  59. package/dist/rows/row/context.js +11 -1
  60. package/dist/rows/row/row.d.ts +1 -1
  61. package/dist/rows/row/row.js +9 -7
  62. package/dist/rows/row/use-row-context-value.d.ts +4 -4
  63. package/dist/rows/row/use-row-context-value.js +18 -3
  64. package/dist/rows/row-detail-row.js +1 -1
  65. package/dist/rows/row-full-width.js +7 -5
  66. package/dist/rows/rows-container.js +1 -1
  67. package/dist/rows/rows-sections.js +3 -3
  68. package/dist/rows/scrollers/native-scroller.js +1 -15
  69. package/dist/sort-manager/root.d.ts +1 -1
  70. package/dist/sort-manager/root.js +1 -1
  71. package/dist/sort-manager/sort-add.js +1 -1
  72. package/dist/sort-manager/sort-apply.js +2 -2
  73. package/dist/sort-manager/sort-cancel.js +2 -2
  74. package/dist/sort-manager/sort-clear.js +1 -1
  75. package/dist/sort-manager/sort-column-select.js +1 -1
  76. package/dist/sort-manager/sort-direction-select.js +1 -1
  77. package/dist/sort-manager/sort-manager.d.ts +11 -11
  78. package/dist/sort-manager/sort-manager.js +12 -12
  79. package/dist/sort-manager/sort-remove.js +1 -1
  80. package/dist/sort-manager/sort-row.d.ts +1 -1
  81. package/dist/sort-manager/sort-row.js +2 -2
  82. package/dist/sort-manager/sort-rows.js +1 -1
  83. package/dist/sort-manager/sort-value-select.js +1 -1
  84. package/dist/state/+types.d.ts +2 -0
  85. package/dist/state/api/cell-root.js +2 -2
  86. package/dist/state/helpers/row-layout/row-layout.js +8 -7
  87. package/dist/state/use-lytenyte.js +12 -2
  88. package/dist/tree-view/root.js +1 -1
  89. package/dist/viewport/viewport.js +2 -2
  90. package/package.json +7 -7
@@ -1,15 +1,15 @@
1
- import { Root } from "./root";
2
- import { SortRow } from "./sort-row";
3
- import { SortRows } from "./sort-rows";
4
- import { useSortManager } from "./hooks/use-sort-manager";
5
- import { SortColumnSelect } from "./sort-column-select";
6
- import { SortValueSelect } from "./sort-value-select";
7
- import { SortDirectionSelect } from "./sort-direction-select";
8
- import { SortAdd } from "./sort-add";
9
- import { SortRemove } from "./sort-remove";
10
- import { SortCancel } from "./sort-cancel";
11
- import { SortClear } from "./sort-clear";
12
- import { SortApply } from "./sort-apply";
1
+ import { Root } from "./root.js";
2
+ import { SortRow } from "./sort-row.js";
3
+ import { SortRows } from "./sort-rows.js";
4
+ import { useSortManager } from "./hooks/use-sort-manager.js";
5
+ import { SortColumnSelect } from "./sort-column-select.js";
6
+ import { SortValueSelect } from "./sort-value-select.js";
7
+ import { SortDirectionSelect } from "./sort-direction-select.js";
8
+ import { SortAdd } from "./sort-add.js";
9
+ import { SortRemove } from "./sort-remove.js";
10
+ import { SortCancel } from "./sort-cancel.js";
11
+ import { SortClear } from "./sort-clear.js";
12
+ import { SortApply } from "./sort-apply.js";
13
13
  export const SortManager = {
14
14
  Root,
15
15
  Row: SortRow,
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useSlot } from "@1771technologies/lytenyte-react-hooks";
3
3
  import { forwardRef } from "react";
4
- import { useSortRowCtx } from "./context";
4
+ import { useSortRowCtx } from "./context.js";
5
5
  export const SortRemove = forwardRef(function SortRemove({ as, ...props }, forwarded) {
6
6
  const row = useSortRowCtx();
7
7
  const renderer = useSlot({
@@ -1,4 +1,4 @@
1
- import type { SortRowItem } from "./hooks/use-sort-row-item";
1
+ import type { SortRowItem } from "./hooks/use-sort-row-item.js";
2
2
  export interface SortRowProps {
3
3
  readonly row: SortRowItem;
4
4
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { Item } from "../listbox/item";
4
- import { rowContext } from "./context";
3
+ import { Item } from "../listbox/item.js";
4
+ import { rowContext } from "./context.js";
5
5
  export const SortRow = forwardRef(function SortRow({ row, ...props }, forwarded) {
6
6
  return (_jsx(rowContext.Provider, { value: row, children: _jsx(Item, { ...props, ref: forwarded }) }));
7
7
  });
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { Panel } from "../listbox/panel";
3
+ import { Panel } from "../listbox/panel.js";
4
4
  export const SortRows = forwardRef(function SortRows(props, forwarded) {
5
5
  return _jsx(Panel, { ...props, ref: forwarded });
6
6
  });
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useSlot } from "@1771technologies/lytenyte-react-hooks";
3
3
  import { forwardRef } from "react";
4
- import { useSortRowCtx } from "./context";
4
+ import { useSortRowCtx } from "./context.js";
5
5
  export const SortValueSelect = forwardRef(function SortValueSelect({ as, ...props }, forwarded) {
6
6
  const row = useSortRowCtx();
7
7
  const el = (_jsxs("select", { "aria-label": "Select sort value", value: row.sortSelected?.value ?? "", onChange: (e) => {
@@ -8,6 +8,8 @@ export interface InternalAtoms {
8
8
  readonly xScroll: GridAtom<number>;
9
9
  readonly yScroll: GridAtom<number>;
10
10
  readonly layout: LayoutState;
11
+ readonly hasSpans: GridAtomReadonly<boolean>;
12
+ readonly colBounds: GridAtomReadonly<[number, number]>;
11
13
  readonly focusActive: GridAtom<PositionUnion | null>;
12
14
  readonly focusPrevColIndex: GridAtom<number | null>;
13
15
  readonly focusPrevRowIndex: GridAtom<number | null>;
@@ -1,6 +1,6 @@
1
1
  import { CONTAINS_DEAD_CELLS, FULL_WIDTH, updateLayout } from "@1771technologies/lytenyte-shared";
2
- import { getSpanFn } from "../helpers/get-span-callback";
3
- import { getFullWidthCallback } from "../helpers/get-full-width-callback";
2
+ import { getSpanFn } from "../helpers/get-span-callback.js";
3
+ import { getFullWidthCallback } from "../helpers/get-full-width-callback.js";
4
4
  export const makeCellRoot = (grid) => {
5
5
  return (row, column) => {
6
6
  const l = grid.internal.layout;
@@ -69,9 +69,6 @@ const partition = (n, row) => {
69
69
  };
70
70
  };
71
71
  function handleViewLayout({ columns, spanLayout: n, rowStart, rowEnd, rowPin, layout, viewCache, container, rowForIndex, }) {
72
- /**
73
- * TOP ROW LAYOUT START
74
- */
75
72
  for (let r = rowStart; r < rowEnd; r++) {
76
73
  const status = layout.special[r];
77
74
  const computed = layout.computed[r];
@@ -87,7 +84,9 @@ function handleViewLayout({ columns, spanLayout: n, rowStart, rowEnd, rowPin, la
87
84
  const rowLastPinTop = n.rowTopEnd - 1 === r ? true : undefined;
88
85
  if (status === FULL_WIDTH) {
89
86
  const row = {
90
- id: node.get()?.id ?? `${r}`,
87
+ get id() {
88
+ return node.get()?.id ?? `${r}`;
89
+ },
91
90
  rowIndex: r,
92
91
  kind: "full-width",
93
92
  rowPin,
@@ -155,7 +154,7 @@ function handleViewLayout({ columns, spanLayout: n, rowStart, rowEnd, rowPin, la
155
154
  rowIndex: r,
156
155
  rowSpan: cellSpec?.[c * 4] || 1,
157
156
  colSpan: cellSpec?.[c * 4 + 1] || 1,
158
- rowPin: "top",
157
+ rowPin,
159
158
  colPin: "end",
160
159
  isDeadCol,
161
160
  isDeadRow,
@@ -166,11 +165,13 @@ function handleViewLayout({ columns, spanLayout: n, rowStart, rowEnd, rowPin, la
166
165
  });
167
166
  }
168
167
  const row = {
169
- id: node.get()?.id ?? `${r}`,
168
+ get id() {
169
+ return node.get()?.id ?? `${r}`;
170
+ },
170
171
  rowIndex: r,
171
172
  kind: "row",
172
173
  cells: cellLayout,
173
- rowPin: "top",
174
+ rowPin,
174
175
  row: node,
175
176
  rowLastPinTop,
176
177
  };
@@ -246,6 +246,10 @@ export function makeLyteNyte(p) {
246
246
  });
247
247
  return bounds;
248
248
  }, { dirty: (prev, next) => !equal(prev, next) });
249
+ const internal_colBounds = computed(() => {
250
+ const b = bounds();
251
+ return [b.colCenterStart, b.colCenterEnd];
252
+ }, { dirty: (l, r) => !equal(l, r) });
249
253
  /**
250
254
  * COLUMN VIEW
251
255
  * Compute the column layout. This impacts both the row layout and header layout. Column layout
@@ -390,6 +394,10 @@ export function makeLyteNyte(p) {
390
394
  }, innerHeight - headerHeight);
391
395
  });
392
396
  const heightTotal = computed(() => yPositions().at(-1));
397
+ const hasSpans = computed(() => {
398
+ const visible = columnMeta().columnsVisible;
399
+ return cellSelectionMode() !== "none" || !visible.every((c) => !(c.colSpan || c.rowSpan));
400
+ });
393
401
  const rowView = computed(() => {
394
402
  if (!viewport())
395
403
  return {
@@ -412,7 +420,7 @@ export function makeLyteNyte(p) {
412
420
  const rowScan = rowScanDistance();
413
421
  const columns = columnMeta().columnsVisible;
414
422
  const rds = rowDataSource();
415
- const { layout } = layoutState$();
423
+ const { layout, cache } = layoutState$();
416
424
  const topCount = rowDataStore.rowTopCount.$();
417
425
  const botCount = rowDataStore.rowBottomCount.$();
418
426
  const rowCount = rowDataStore.rowCount.$();
@@ -441,7 +449,7 @@ export function makeLyteNyte(p) {
441
449
  const focus = internal_focusActive();
442
450
  const view = makeRowLayout({
443
451
  view: n,
444
- viewCache: new Map(),
452
+ viewCache: cache,
445
453
  layout,
446
454
  rds: rowDataStore,
447
455
  columns,
@@ -609,6 +617,8 @@ export function makeLyteNyte(p) {
609
617
  xScroll: makeAtom(xScroll),
610
618
  yScroll: makeAtom(yScroll),
611
619
  layout: layoutState,
620
+ colBounds: makeAtom(internal_colBounds),
621
+ hasSpans: makeAtom(hasSpans),
612
622
  focusActive: makeAtom(internal_focusActive),
613
623
  focusPrevColIndex: makeAtom(internal_focusPrevCol),
614
624
  focusPrevRowIndex: makeAtom(internal_focusPrevRow),
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useMemo, useRef, useState } from "react";
3
- import { context } from "./context";
3
+ import { context } from "./context.js";
4
4
  import { useCombinedRefs, useEvent } from "@1771technologies/lytenyte-react-hooks";
5
5
  import { getAllIds } from "./navigation/get-all-ids.js";
6
6
  import { getIdsBetweenNodes } from "./utils/get-ids-between-nodes.js";
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { useCombinedRefs } from "@1771technologies/lytenyte-react-hooks";
4
- import { useGridRoot } from "../context";
4
+ import { useGridRoot } from "../context.js";
5
5
  import { handleNavigationKeys, handleSkipInner, useFocusTracking, } from "@1771technologies/lytenyte-shared";
6
- import { beginEditing } from "./begin-editing";
6
+ import { beginEditing } from "./begin-editing.js";
7
7
  export const Viewport = forwardRef(function Viewport({ children, style, ...props }, forwarded) {
8
8
  const ctx = useGridRoot();
9
9
  const ref = useCombinedRefs(ctx.ref, forwarded);
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.7",
4
+ "version": "1.0.9",
5
5
  "type": "module",
6
6
  "license": "COMMERCIAL",
7
7
  "files": [
@@ -49,12 +49,12 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@1771technologies/atom": "^1.0.2",
52
- "@1771technologies/lytenyte-core": "1.0.7",
53
- "@1771technologies/lytenyte-shared": "1.0.7",
54
- "@1771technologies/lytenyte-dom-utils": "1.0.7",
55
- "@1771technologies/lytenyte-js-utils": "1.0.7",
56
- "@1771technologies/lytenyte-dragon": "1.0.7",
57
- "@1771technologies/lytenyte-react-hooks": "1.0.7"
52
+ "@1771technologies/lytenyte-core": "1.0.9",
53
+ "@1771technologies/lytenyte-dom-utils": "1.0.9",
54
+ "@1771technologies/lytenyte-react-hooks": "1.0.9",
55
+ "@1771technologies/lytenyte-dragon": "1.0.9",
56
+ "@1771technologies/lytenyte-js-utils": "1.0.9",
57
+ "@1771technologies/lytenyte-shared": "1.0.9"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "react": "^18.0.0 || ^19.0.0",