@1771technologies/lytenyte-pro 2.0.1 → 2.0.2

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 (32) hide show
  1. package/README.md +1 -1
  2. package/SECURITY.md +22 -0
  3. package/css/components.css +4 -4
  4. package/css/grid.css +1 -1
  5. package/dist/__play__/alpha.play.d.ts +1 -0
  6. package/dist/__play__/alpha.play.js +3 -3
  7. package/dist/__play__/basic-server-data/page-data.d.ts +16 -0
  8. package/dist/__play__/basic-server-data/page-data.js +21002 -0
  9. package/dist/__play__/basic-server-data/page-server.d.ts +31 -0
  10. package/dist/__play__/basic-server-data/page-server.js +25 -0
  11. package/dist/__play__/paginated.play.d.ts +7 -0
  12. package/dist/__play__/paginated.play.js +48 -0
  13. package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.d.ts +1 -2
  14. package/dist/cell-selection/cell-style-row.d.ts +1 -1
  15. package/dist/cell-selection/cell-style-row.js +1 -1
  16. package/dist/cell-selection/index.d.ts +0 -2
  17. package/dist/cell-selection/index.js +0 -2
  18. package/dist/cell-selection/split-cell-selection-rect.d.ts +1 -7
  19. package/dist/cell-selection/split-cell-selection-rect.js +2 -6
  20. package/dist/cell-selection/update-additive-cell-selection.d.ts +1 -1
  21. package/dist/components/column-manager/column-manager.d.ts +1 -1
  22. package/dist/components/column-manager/column-manager.js +30 -10
  23. package/dist/components/pill-manager/pill-manager.play.d.ts +1 -0
  24. package/dist/components/pill-manager/pill-manager.play.js +3 -2
  25. package/dist/components/smart-select/root.js +1 -1
  26. package/dist/components/tree-view/root.js +1 -0
  27. package/dist/data-source-client/hooks/use-flattened-groups.js +1 -1
  28. package/dist/root/root.js +1 -1
  29. package/dist/types/grid.d.ts +0 -1
  30. package/package.json +6 -5
  31. package/dist/cell-selection/split-on-pivot.d.ts +0 -3
  32. package/dist/cell-selection/split-on-pivot.js +0 -50
@@ -0,0 +1,31 @@
1
+ import type { DataRequest } from "../../data-source-server/types.js";
2
+ export declare function Server(reqs: DataRequest[], page: number, pageSize: number): Promise<{
3
+ pages: {
4
+ asOfTime: number;
5
+ data: {
6
+ kind: "leaf";
7
+ id: string;
8
+ data: {
9
+ link: string;
10
+ name: string;
11
+ released_at: string;
12
+ genre: string;
13
+ poster: string;
14
+ streaming_on: string;
15
+ country: string;
16
+ number_of_seasons: string;
17
+ type: string;
18
+ content_rating: string;
19
+ imdb_rating: string;
20
+ uniq_id: string;
21
+ scraped_at: string;
22
+ };
23
+ }[];
24
+ start: number;
25
+ end: number;
26
+ kind: "center";
27
+ path: (string | null)[];
28
+ size: number;
29
+ }[];
30
+ pageCount: number;
31
+ }>;
@@ -0,0 +1,25 @@
1
+ import { data } from "./page-data.js";
2
+ const sleep = () => new Promise((res) => setTimeout(res, 600));
3
+ export async function Server(reqs, page, pageSize) {
4
+ // Simulate latency and server work.
5
+ await sleep();
6
+ const pageCount = Math.ceil(data.length / pageSize);
7
+ const pageStart = page * pageCount;
8
+ const pages = reqs.map((c) => {
9
+ return {
10
+ asOfTime: Date.now(),
11
+ data: data.slice(pageStart, pageStart + pageSize).map((x) => {
12
+ return { kind: "leaf", id: x.uniq_id, data: x };
13
+ }),
14
+ start: c.start,
15
+ end: c.end,
16
+ kind: "center",
17
+ path: c.path,
18
+ size: pageSize,
19
+ };
20
+ });
21
+ return {
22
+ pages,
23
+ pageCount,
24
+ };
25
+ }
@@ -0,0 +1,7 @@
1
+ import "@1771technologies/lytenyte-design/fonts.css";
2
+ import "../../css/grid-full.css";
3
+ import type { MovieData } from "./basic-server-data/page-data";
4
+ export interface GridSpec {
5
+ readonly data: MovieData;
6
+ }
7
+ export default function Experimental(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTheme } from "@1771technologies/play-frame";
3
+ import "@1771technologies/lytenyte-design/fonts.css";
4
+ import "../../css/grid-full.css";
5
+ import { useRef, useState } from "react";
6
+ import { RowGroupCell } from "../components/row-group-cell.js";
7
+ import { useServerDataSource } from "../data-source-server/use-server-data-source.js";
8
+ import { Server } from "./basic-server-data/page-server.js";
9
+ import { Grid } from "../index.js";
10
+ const columns = [
11
+ {
12
+ id: "#",
13
+ name: "",
14
+ width: 30,
15
+ field: "link",
16
+ widthMin: 30,
17
+ widthMax: 30,
18
+ },
19
+ { id: "name", name: "Title", width: 250, widthFlex: 1 },
20
+ { id: "released_at", name: "Released", width: 120 },
21
+ { id: "genre", name: "Genre" },
22
+ { id: "type", name: "Type", width: 120 },
23
+ { id: "imdb_rating", name: "Rating", width: 120 },
24
+ ];
25
+ export default function Experimental() {
26
+ const [page, setPage] = useState(0);
27
+ const [pageCount, setPageCount] = useState(null);
28
+ const [pageSize, setPageSize] = useState(20);
29
+ const ds = useServerDataSource({
30
+ rowGroupDefaultExpansion: true,
31
+ queryFn: async ({ requests, queryKey }) => {
32
+ const page = queryKey[0];
33
+ const pageSize = queryKey[1];
34
+ const result = await Server(requests, page, pageSize);
35
+ setPageCount(pageCount);
36
+ return result.pages;
37
+ },
38
+ queryKey: [page, pageSize],
39
+ });
40
+ const [rowGroupColumn, setRowGroupColumn] = useState({
41
+ cellRenderer: RowGroupCell,
42
+ });
43
+ const isLoading = ds.isLoading.useValue();
44
+ const error = ds.loadingError.useValue();
45
+ const { resolvedTheme } = useTheme();
46
+ const ref = useRef(null);
47
+ return (_jsxs(_Fragment, { children: [_jsx("div", { style: { height: 40 }, children: _jsxs(_Fragment, { children: [isLoading && _jsx("div", { children: "Loading..." }), error && _jsx("div", { children: `${error}` })] }) }), _jsx("div", { children: _jsx("button", { onClick: () => setPageSize((prev) => prev + 10), children: "Page " }) }), _jsx("div", { children: _jsx("button", { onClick: () => setPage((next) => next + 1), children: "Next" }) }), _jsx("div", { style: { display: "flex", alignItems: "center", justifyContent: "center" }, children: _jsx("div", { className: "ln-grid " + (resolvedTheme === "light" ? "ln-light" : "ln-dark"), style: { height: "50vh", width: "90vw" }, children: _jsx(Grid, { columns: columns, rowSource: ds, rowHeight: "fill:30", rowGroupColumn: rowGroupColumn, onRowGroupColumnChange: setRowGroupColumn, virtualizeRows: false, ref: ref }) }) })] }));
48
+ }
@@ -1,6 +1,5 @@
1
1
  import type { PieceWritable } from "@1771technologies/lytenyte-core";
2
2
  import { type PositionUnion } from "@1771technologies/lytenyte-shared";
3
3
  import { type Dispatch, type SetStateAction } from "react";
4
- import type { DataRectSplit } from "../split-cell-selection-rect";
5
- import type { API, DataRect } from "../../types";
4
+ import type { API, DataRect, DataRectSplit } from "../../types";
6
5
  export declare function useCellFocusChange(focusActive: PieceWritable<PositionUnion | null>, excludeMarker: boolean, keepSelection: boolean, onCellSelectionChange: (c: DataRect[]) => void, setCellSelectionAdditiveRects: Dispatch<SetStateAction<DataRectSplit[] | null>>, api: API): void;
@@ -1,4 +1,4 @@
1
- import type { DataRectSplit } from "./split-cell-selection-rect.js";
1
+ import type { DataRectSplit } from "../types/grid";
2
2
  export declare function CellStyleRow({ rect, isRowPinnedTop, isDeselect, isRowPinnedBottom, isPivot, }: {
3
3
  rect: DataRectSplit;
4
4
  isRowPinnedTop?: boolean;
@@ -75,5 +75,5 @@ export function CellStyleRow({ rect, isRowPinnedTop, isDeselect, isRowPinnedBott
75
75
  rowTopCount,
76
76
  rtl,
77
77
  ]);
78
- return (_jsx("div", { style: style, "data-ln-cell-selection-rect": true, "data-ln-cell-selection-is-deselect": isDeselect, "data-ln-cell-selection-is-pivot": isPivot, "data-ln-cell-selection-is-unit": rect.isUnit, "data-ln-cell-selection-border-top": rect.borderTop, "data-ln-cell-selection-border-bottom": rect.borderBottom, "data-ln-cell-selection-border-start": rect.borderStart, "data-ln-cell-selection-border-end": rect.borderEnd }));
78
+ return (_jsx("div", { style: style, "data-ln-cell-selection-rect": true, "data-ln-cell-selection-is-deselect": isDeselect, "data-ln-cell-selection-is-pivot": isPivot, "data-ln-cell-selection-border-top": rect.borderTop, "data-ln-cell-selection-border-bottom": rect.borderBottom, "data-ln-cell-selection-border-start": rect.borderStart, "data-ln-cell-selection-border-end": rect.borderEnd }));
79
79
  }
@@ -1,9 +1,7 @@
1
1
  export { isWithinSelectionRect } from "./is-within-selection-rect.js";
2
- export { splitCellSelectionRect } from "./split-cell-selection-rect.js";
3
2
  export { boundSelectionRect } from "./bound-selection-rect.js";
4
3
  export { fullWidthStartEndIndex } from "./full-width-start-end-index.js";
5
4
  export { areRectsEqual } from "./are-rects-equal.js";
6
- export { deselectRectRange } from "./deselect-rect-range.js";
7
5
  export { updateAdditiveCellSelection } from "./update-additive-cell-selection.js";
8
6
  export { isBottomRect } from "./is-bottom-rect.js";
9
7
  export { isCenterRect } from "./is-center-rect.js";
@@ -1,9 +1,7 @@
1
1
  export { isWithinSelectionRect } from "./is-within-selection-rect.js";
2
- export { splitCellSelectionRect } from "./split-cell-selection-rect.js";
3
2
  export { boundSelectionRect } from "./bound-selection-rect.js";
4
3
  export { fullWidthStartEndIndex } from "./full-width-start-end-index.js";
5
4
  export { areRectsEqual } from "./are-rects-equal.js";
6
- export { deselectRectRange } from "./deselect-rect-range.js";
7
5
  export { updateAdditiveCellSelection } from "./update-additive-cell-selection.js";
8
6
  export { isBottomRect } from "./is-bottom-rect.js";
9
7
  export { isCenterRect } from "./is-center-rect.js";
@@ -1,4 +1,5 @@
1
1
  import type { DataRect } from "../types/api.js";
2
+ import type { DataRectSplit } from "../types/grid.js";
2
3
  interface SplitCellSelectionRectArgs {
3
4
  readonly rect: DataRect;
4
5
  readonly colStartCount: number;
@@ -7,13 +8,6 @@ interface SplitCellSelectionRectArgs {
7
8
  readonly rowCenterCount: number;
8
9
  readonly isDeselect?: boolean;
9
10
  }
10
- export interface DataRectSplit extends DataRect {
11
- readonly isUnit: boolean;
12
- readonly borderTop?: boolean;
13
- readonly borderBottom?: boolean;
14
- readonly borderStart?: boolean;
15
- readonly borderEnd?: boolean;
16
- }
17
11
  /**
18
12
  * Splits a cell selection rectangle into multiple rectangles when it crosses specified boundary regions.
19
13
  * This is useful for handling selections that span across different grid sections (e.g., fixed columns/rows,
@@ -31,7 +31,6 @@ export function splitCellSelectionRect({ rect, colStartCount, colCenterCount, ro
31
31
  // Calculate the boundary positions for columns
32
32
  const colStartBound = colStartCount;
33
33
  const colEndBound = colStartCount + colCenterCount;
34
- const isUnit = rect.rowEnd - rect.rowStart === 1 && rect.columnEnd - rect.columnStart === 1;
35
34
  const colSplits = [];
36
35
  // Handle column splits first
37
36
  // Case 1: Selection starts before the fixed columns and extends into the scrollable area
@@ -39,7 +38,6 @@ export function splitCellSelectionRect({ rect, colStartCount, colCenterCount, ro
39
38
  const startSplit = {
40
39
  ...rect,
41
40
  columnEnd: colStartBound,
42
- isUnit,
43
41
  };
44
42
  colSplits.push(startSplit);
45
43
  rect = { ...rect, columnStart: colStartBound };
@@ -49,13 +47,12 @@ export function splitCellSelectionRect({ rect, colStartCount, colCenterCount, ro
49
47
  const endSplit = {
50
48
  ...rect,
51
49
  columnStart: colEndBound,
52
- isUnit,
53
50
  };
54
51
  rect = { ...rect, columnEnd: colEndBound };
55
52
  colSplits.push(endSplit);
56
53
  }
57
54
  // Add the remaining rectangle after column splits
58
- colSplits.push({ ...rect, isUnit });
55
+ colSplits.push({ ...rect });
59
56
  // Calculate the boundary positions for rows
60
57
  const topBound = rowTopCount;
61
58
  const bottomBound = rowTopCount + rowCenterCount;
@@ -64,7 +61,7 @@ export function splitCellSelectionRect({ rect, colStartCount, colCenterCount, ro
64
61
  for (let split of colSplits) {
65
62
  // Case 1: Selection spans from top section into center section
66
63
  if (split.rowStart < topBound && split.rowEnd > topBound) {
67
- const topSplit = { ...split, rowEnd: topBound, isUnit };
64
+ const topSplit = { ...split, rowEnd: topBound };
68
65
  split = { ...split, rowStart: topBound };
69
66
  rowSplits.push(topSplit);
70
67
  }
@@ -73,7 +70,6 @@ export function splitCellSelectionRect({ rect, colStartCount, colCenterCount, ro
73
70
  const bottomSplit = {
74
71
  ...split,
75
72
  rowStart: bottomBound,
76
- isUnit,
77
73
  };
78
74
  split = { ...split, rowEnd: bottomBound };
79
75
  rowSplits.push(bottomSplit);
@@ -1,4 +1,4 @@
1
- import { type DataRectSplit } from "./split-cell-selection-rect.js";
2
1
  import type { ColumnView } from "@1771technologies/lytenyte-shared";
3
2
  import type { API, DataRect } from "../types/api.js";
3
+ import type { DataRectSplit } from "../types/grid.js";
4
4
  export declare function updateAdditiveCellSelection(api: API, view: ColumnView, rowTopCount: number, rowCount: number, rowBottomCount: number, rect: DataRect, cellSelectionAdditiveRects: DataRectSplit[] | null, setSelectionAdditiveRects: (d: DataRectSplit[] | null) => void): void;
@@ -10,4 +10,4 @@ export interface ColumnManagerProps<Spec extends GridSpec = GridSpec> {
10
10
  row: RowNode<Spec["data"]>;
11
11
  }) => ReactNode;
12
12
  }
13
- export declare function ColumnManager<Spec extends GridSpec = GridSpec>({ columns, base, onColumnsChange, endElement, }: ColumnManagerProps<Spec>): import("react/jsx-runtime").JSX.Element;
13
+ export declare function ColumnManager<Spec extends GridSpec = GridSpec>({ columns: provided, base, onColumnsChange, endElement, }: ColumnManagerProps<Spec>): import("react/jsx-runtime").JSX.Element;
@@ -2,12 +2,30 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
3
  import { TreeView } from "../tree-view/index.js";
4
4
  import { Checkbox } from "../checkbox/checkbox.js";
5
- export function ColumnManager({ columns, base, onColumnsChange, endElement, }) {
5
+ import { computePathMatrix } from "@1771technologies/lytenyte-shared";
6
+ export function ColumnManager({ columns: provided, base, onColumnsChange, endElement, }) {
7
+ const nonAdjacentSplit = useMemo(() => {
8
+ const paths = computePathMatrix(provided);
9
+ const adjusted = [];
10
+ for (let i = 0; i < provided.length; i++) {
11
+ const col = provided[i];
12
+ const path = paths[i];
13
+ const group = path
14
+ .filter((x) => x != null)
15
+ .map((x) => x?.idOccurrence.split("#").slice(-2).join("#"))
16
+ .flat();
17
+ if (group.length)
18
+ adjusted.push({ ...col, groupPath: group });
19
+ else
20
+ adjusted.push(col);
21
+ }
22
+ return adjusted;
23
+ }, [provided]);
6
24
  const items = useMemo(() => {
7
- return columns.map((x) => ({ id: x.id, path: x.groupPath ?? [], name: x.name, column: x }));
8
- }, [columns]);
25
+ return nonAdjacentSplit.map((x) => ({ id: x.id, path: x.groupPath ?? [], name: x.name, column: x }));
26
+ }, [nonAdjacentSplit]);
9
27
  return (_jsx(TreeView, { items: items, rowSelectionEnabled: false, draggable: true, rowHeight: 30, rowSelectAllShow: false, defaultExpansion: true, onItemsReordered: (x) => {
10
- const columns = x.map((x) => x.column);
28
+ const columns = x.map((x) => provided.find((p) => p.id === x.column.id));
11
29
  onColumnsChange(columns);
12
30
  }, children: ({ row, leafs, toggle, dragProps, isOver, isBefore }) => {
13
31
  const depth = row.depth;
@@ -18,25 +36,27 @@ export function ColumnManager({ columns, base, onColumnsChange, endElement, }) {
18
36
  const draggable = !!dragProps.draggable;
19
37
  const checkbox = (_jsx(Checkbox, { checked: isSelected, indeterminate: isIndeterminate, onChange: () => {
20
38
  if (isSelected) {
21
- onColumnsChange(columns.map((x) => {
39
+ onColumnsChange(provided.map((x) => {
22
40
  const c = items.find((c) => x.id === c.column.id);
23
41
  if (!c)
24
42
  return x;
25
- return { ...c.column, hide: true };
43
+ const original = provided.find((x) => x.id === c.id);
44
+ return { ...original, hide: true };
26
45
  }));
27
46
  }
28
47
  else {
29
- onColumnsChange(columns.map((x) => {
48
+ onColumnsChange(provided.map((x) => {
30
49
  const c = items.find((c) => x.id === c.column.id);
31
50
  if (!c)
32
51
  return x;
33
- return { ...c.column, hide: false };
52
+ const original = provided.find((x) => x.id === c.id);
53
+ return { ...original, hide: false };
34
54
  }));
35
55
  }
36
56
  } }));
37
57
  if (row.kind === "branch")
38
- return (_jsxs("div", { "data-ln-tree-view-cell": row.kind, "data-ln-tree-view-cell-expanded": row.kind === "branch" && row.expanded, "data-ln-tree-view-cell-expandable": row.kind === "branch" ? row.expandable : undefined, "data-ln-tree-over": isOver, "data-ln-tree-before": isBefore, style: { "--ln-row-depth": depth }, ...dragProps, children: [row.kind === "branch" && row.expandable && (_jsx("button", { "data-ln-tree-view-cell-expander": true, "aria-label": "toggle the row group expansion state", onClick: () => toggle(), children: !row.loadingGroup && _jsx(CaretRight, {}) })), draggable && (_jsx("div", { children: _jsx(DragDots, {}) })), checkbox, _jsx("div", { style: { flex: "1" }, children: row.key }), end] }));
39
- return (_jsxs("div", { "data-ln-tree-view-cell": row.kind, "data-ln-tree-over": isOver, "data-ln-tree-before": isBefore, style: { "--ln-row-depth": depth }, ...dragProps, children: [draggable && (_jsx("div", { children: _jsx(DragDots, {}) })), checkbox, _jsx("div", { style: { flex: "1" }, children: row.data.name ?? row.data.id }), end] }));
58
+ return (_jsxs("div", { "data-ln-tree-view-cell": row.kind, "data-ln-tree-view-cell-expanded": row.kind === "branch" && row.expanded, "data-ln-tree-view-cell-expandable": row.kind === "branch" ? row.expandable : undefined, "data-ln-tree-over": isOver, "data-ln-tree-before": isBefore, style: { "--ln-row-depth": depth }, ...dragProps, children: [row.kind === "branch" && row.expandable && (_jsx("button", { "data-ln-tree-view-cell-expander": true, "aria-label": "toggle the row group expansion state", onClick: () => toggle(), children: !row.loadingGroup && _jsx(CaretRight, {}) })), draggable && (_jsx("div", { style: { cursor: "grab" }, children: _jsx(DragDots, {}) })), checkbox, _jsx("div", { style: { flex: "1" }, children: row.key?.split("#").slice(0, -1).join("") }), end] }));
59
+ return (_jsxs("div", { "data-ln-tree-view-cell": row.kind, "data-ln-tree-over": isOver, "data-ln-tree-before": isBefore, style: { "--ln-row-depth": depth }, ...dragProps, children: [draggable && (_jsx("div", { style: { cursor: "grab" }, children: _jsx(DragDots, {}) })), checkbox, _jsx("div", { style: { flex: "1" }, children: row.data.name ?? row.data.id }), end] }));
40
60
  } }));
41
61
  }
42
62
  function CaretRight() {
@@ -1,3 +1,4 @@
1
1
  import "@1771technologies/lytenyte-design/light-dark.css";
2
+ import "@1771technologies/lytenyte-design/shadcn-vars.css";
2
3
  import "../../../css/pill-manager.css";
3
4
  export default function Demo(): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import "@1771technologies/lytenyte-design/light-dark.css";
3
+ import "@1771technologies/lytenyte-design/shadcn-vars.css";
3
4
  import "../../../css/pill-manager.css";
4
5
  import { PillManager } from "./root.js";
5
6
  import { useState } from "react";
@@ -29,13 +30,13 @@ export default function Demo() {
29
30
  },
30
31
  {
31
32
  id: "group",
32
- type: "row-pivots",
33
+ type: "row-groups",
33
34
  label: "Row Groups",
34
35
  accepts: ["groupable"],
35
36
  pills: columns.filter((x) => x.grouped).map((x) => ({ ...x, active: true, movable: true })),
36
37
  },
37
38
  ]);
38
- return (_jsxs("div", { style: { display: "flex", gap: 8, flexDirection: "column" }, children: [_jsx("div", { style: { height: "200px" }, children: _jsx(PillManager, { rows: state, onPillRowChange: (p) => {
39
+ return (_jsxs("div", { className: "ln-shadcn", style: { display: "flex", gap: 8, flexDirection: "column" }, children: [_jsx("div", { style: { height: "200px" }, children: _jsx(PillManager, { rows: state, onPillRowChange: (p) => {
39
40
  setState(p.full);
40
41
  }, onPillItemThrown: (x) => {
41
42
  setState((prev) => {
@@ -158,7 +158,7 @@ export function SmartSelectRoot(p) {
158
158
  return true;
159
159
  return false;
160
160
  }, [triggerEl]);
161
- return (_jsx(SmartSelectProvider, { value: value, children: _jsxs(Popover, { open: open, onOpenChange: onOpenChange, onOpenChangeComplete: p.onOpenChangeComplete, focusTrap: false, modal: false, anchor: triggerEl, lightDismiss: lightDismiss, children: [trigger, triggerEl && createPortal(container, triggerEl)] }) }));
161
+ return (_jsx(SmartSelectProvider, { value: value, children: _jsxs(Popover, { open: open, onOpenChange: onOpenChange, onOpenChangeComplete: p.onOpenChangeComplete, focusTrap: false, modal: false, anchor: triggerEl, lightDismiss: lightDismiss, children: [trigger, triggerEl && createPortal(container, p.kind === "combo" ? triggerEl.parentElement : triggerEl)] }) }));
162
162
  }
163
163
  function DefaultChildren(p) {
164
164
  return _jsx(Option, { ...p });
@@ -25,6 +25,7 @@ function TreeViewBase({ items, rowSelectAllShow: rowSelectAll = true, defaultExp
25
25
  group: groupFn,
26
26
  data: finalItems,
27
27
  rowGroupDefaultExpansion: defaultExpansion ?? false,
28
+ sort: null,
28
29
  leafIdFn: useCallback((d) => d.id, []),
29
30
  groupIdFn: useCallback((p) => p.join(branchJoinSeparator), [branchJoinSeparator]),
30
31
  rowGroupExpansions,
@@ -12,7 +12,7 @@ export function useFlattenedGroups(root, agg, leafs, workingSet, sort, expandedF
12
12
  let maxDepth = 0;
13
13
  function processRowsBetter(node, parent, start, isLast, depth = 0) {
14
14
  maxDepth = Math.max(depth + 1, maxDepth);
15
- const rows = nodeChildrenToRows(node, agg, leafs, workingSet, sort ?? sortFallback, isLast && !ignoreIsLast);
15
+ const rows = nodeChildrenToRows(node, agg, leafs, workingSet, sort !== undefined ? sort : sortFallback, isLast && !ignoreIsLast);
16
16
  let offset = 0;
17
17
  for (let i = 0; i < rows.length; i++) {
18
18
  const row = rows[i];
package/dist/root/root.js CHANGED
@@ -5,9 +5,9 @@ import { useProAPI } from "./hooks/use-pro-api.js";
5
5
  import { ProRootProvider } from "./context.js";
6
6
  import { hasAValidLicense, licenseState } from "../license.js";
7
7
  import { useControlled, useEvent, useRoot } from "@1771technologies/lytenyte-core/internal";
8
- import { splitCellSelectionRect } from "../cell-selection/index.js";
9
8
  import { CellSelectionDriver } from "../cell-selection/cell-selection-driver/cell-selection-driver.js";
10
9
  import { CellSelectionBottom, CellSelectionCenter, CellSelectionTop, } from "../cell-selection/cell-selection-containers.js";
10
+ import { splitCellSelectionRect } from "../cell-selection/split-cell-selection-rect.js";
11
11
  const RootWrapper = ({ children, ...p }, forwarded) => {
12
12
  useEffect(() => {
13
13
  if (hasAValidLicense)
@@ -13,7 +13,6 @@ export interface VirtualTarget {
13
13
  readonly contextElement?: HTMLElement;
14
14
  }
15
15
  export interface DataRectSplit extends DataRect {
16
- readonly isUnit: boolean;
17
16
  readonly borderTop?: boolean;
18
17
  readonly borderBottom?: boolean;
19
18
  readonly borderStart?: boolean;
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@1771technologies/lytenyte-pro",
3
3
  "description": "Blazingly fast headless React data grid with 100s of features.",
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "type": "module",
6
6
  "license": "COMMERCIAL",
7
7
  "files": [
8
8
  "dist",
9
9
  "css",
10
10
  "LICENSE",
11
+ "SECURITY.md",
11
12
  "README.md"
12
13
  ],
13
14
  "keywords": [
@@ -57,12 +58,12 @@
57
58
  "access": "public"
58
59
  },
59
60
  "dependencies": {
60
- "@1771technologies/lytenyte-shared": "2.0.1",
61
- "@1771technologies/lytenyte-core": "2.0.1",
62
- "@1771technologies/lytenyte-design": "2.0.1"
61
+ "@1771technologies/lytenyte-core": "2.0.2",
62
+ "@1771technologies/lytenyte-design": "2.0.2",
63
+ "@1771technologies/lytenyte-shared": "2.0.2"
63
64
  },
64
65
  "devDependencies": {
65
- "@1771technologies/grid-sample-data": "2.0.1"
66
+ "@1771technologies/grid-sample-data": "2.0.2"
66
67
  },
67
68
  "peerDependencies": {
68
69
  "react": "18.0.0 || ^19.0.0",
@@ -1,3 +0,0 @@
1
- import type { DataRectSplit } from "./split-cell-selection-rect";
2
- import type { DataRect } from "../types/api.js";
3
- export declare function splitOnPivot(rect: DataRectSplit, pivot: DataRect): DataRectSplit[] | null;
@@ -1,50 +0,0 @@
1
- import { areRectsEqual } from "./are-rects-equal.js";
2
- export function splitOnPivot(rect, pivot) {
3
- if (rect.isUnit || areRectsEqual(rect, pivot))
4
- return null;
5
- const splits = [];
6
- const isAfter = pivot.columnStart > rect.columnStart;
7
- const isSame = pivot.columnStart === rect.columnStart && pivot.columnEnd === rect.columnEnd;
8
- // The pivot is on the right side of the rect. So we split by end
9
- if (isAfter) {
10
- const split = { ...rect, columnEnd: rect.columnEnd - 1, borderEnd: false };
11
- if (split.columnStart !== split.columnEnd)
12
- splits.push(split);
13
- }
14
- else {
15
- const split = {
16
- ...rect,
17
- columnStart: rect.columnStart + 1,
18
- borderStart: false,
19
- };
20
- if (split.columnStart !== split.columnEnd)
21
- splits.push(split);
22
- }
23
- if (pivot.rowStart > rect.rowStart) {
24
- const split = {
25
- ...rect,
26
- columnStart: pivot.columnStart,
27
- columnEnd: pivot.columnEnd,
28
- rowEnd: rect.rowEnd - 1,
29
- borderBottom: false,
30
- borderStart: !isAfter,
31
- borderEnd: isSame || isAfter,
32
- };
33
- if (split.rowStart !== split.rowEnd)
34
- splits.push(split);
35
- }
36
- else {
37
- const split = {
38
- ...rect,
39
- columnStart: pivot.columnStart,
40
- columnEnd: pivot.columnEnd,
41
- rowStart: rect.rowStart + 1,
42
- borderTop: false,
43
- borderStart: !isAfter,
44
- borderEnd: isSame || isAfter,
45
- };
46
- if (split.rowStart !== split.rowEnd)
47
- splits.push(split);
48
- }
49
- return splits;
50
- }