@1771technologies/lytenyte-pro 1.0.14 → 1.0.16
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.
- package/dist/__play__/cell-selections/cell-selection.play.d.ts +5 -0
- package/dist/__play__/{grid-navigation/normal-layout.play.js → cell-selections/cell-selection.play.js} +32 -24
- package/dist/__play__/filter-select/filter-select.play.d.ts +4 -0
- package/dist/__play__/filter-select/filter-select.play.js +76 -0
- package/dist/__play__/test-utils/row-handler.js +6 -7
- package/dist/cell-selection/bound-selection-rect.js +1 -1
- package/dist/cell-selection/cell-selection-driver.js +12 -8
- package/dist/column-manager/branch.d.ts +1 -1
- package/dist/column-manager/branch.js +1 -1
- package/dist/column-manager/label.d.ts +1 -1
- package/dist/column-manager/label.js +1 -1
- package/dist/column-manager/leaf.js +1 -1
- package/dist/column-manager/move-handle.d.ts +1 -1
- package/dist/column-manager/move-handle.js +1 -2
- package/dist/column-manager/visibility-checkbox.d.ts +1 -1
- package/dist/column-manager/visibility-checkbox.js +1 -1
- package/dist/context.d.ts +2 -1
- package/dist/context.js +5 -4
- package/dist/filter-selects/apply.d.ts +7 -0
- package/dist/filter-selects/apply.js +22 -0
- package/dist/filter-selects/context.d.ts +12 -0
- package/dist/filter-selects/context.js +3 -0
- package/dist/filter-selects/filter-combinator.d.ts +10 -0
- package/dist/filter-selects/filter-combinator.js +19 -0
- package/dist/filter-selects/filter-row-context.d.ts +30 -0
- package/dist/filter-selects/filter-row-context.js +3 -0
- package/dist/filter-selects/filter-row.d.ts +13 -0
- package/dist/filter-selects/filter-row.js +118 -0
- package/dist/filter-selects/index.d.ts +20 -0
- package/dist/filter-selects/index.js +18 -0
- package/dist/filter-selects/is-complete-filter.d.ts +2 -0
- package/dist/filter-selects/is-complete-filter.js +5 -0
- package/dist/filter-selects/operator-select.d.ts +14 -0
- package/dist/filter-selects/operator-select.js +25 -0
- package/dist/filter-selects/options.d.ts +9 -0
- package/dist/filter-selects/options.js +100 -0
- package/dist/filter-selects/reset.d.ts +7 -0
- package/dist/filter-selects/reset.js +22 -0
- package/dist/filter-selects/root.d.ts +13 -0
- package/dist/filter-selects/root.js +5 -0
- package/dist/filter-selects/to-filter-item.d.ts +3 -0
- package/dist/filter-selects/to-filter-item.js +7 -0
- package/dist/filter-selects/use-filter-select.d.ts +37 -0
- package/dist/filter-selects/use-filter-select.js +158 -0
- package/dist/filter-selects/value-input.d.ts +12 -0
- package/dist/filter-selects/value-input.js +27 -0
- package/dist/filter-tree/branch.d.ts +1 -1
- package/dist/filter-tree/branch.js +1 -1
- package/dist/filter-tree/hooks/use-filter-tree.js +1 -1
- package/dist/filter-tree/inclusion-checkbox.d.ts +1 -1
- package/dist/filter-tree/inclusion-checkbox.js +1 -1
- package/dist/filter-tree/label.d.ts +1 -1
- package/dist/filter-tree/label.js +1 -1
- package/dist/filter-tree/root.d.ts +1 -1
- package/dist/filter-tree/root.js +1 -1
- package/dist/grid/cell.d.ts +6 -0
- package/dist/grid/cell.js +3 -0
- package/dist/grid/header-cell.d.ts +10 -0
- package/dist/grid/header-cell.js +3 -0
- package/dist/grid/header-group-cell.d.ts +6 -0
- package/dist/grid/header-group-cell.js +3 -0
- package/dist/grid/header-row.d.ts +5 -0
- package/dist/grid/header-row.js +2 -0
- package/dist/grid/header.d.ts +1 -0
- package/dist/grid/header.js +2 -0
- package/dist/{root → grid}/root.d.ts +1 -1
- package/dist/grid/root.js +37 -0
- package/dist/grid/row-full-width.d.ts +9 -0
- package/dist/grid/row-full-width.js +3 -0
- package/dist/grid/row.d.ts +8 -0
- package/dist/grid/row.js +3 -0
- package/dist/grid/rows-container.d.ts +1 -0
- package/dist/grid/rows-container.js +2 -0
- package/dist/grid/rows-sections.js +13 -0
- package/dist/grid/viewport.js +9 -0
- package/dist/grid-box/item.d.ts +1 -1
- package/dist/grid-box/item.js +1 -2
- package/dist/grid-box/panel.js +1 -1
- package/dist/grid-box/use-aggregation-box-items.js +1 -1
- package/dist/grid-box/use-column-box-items.js +1 -1
- package/dist/grid-box/use-row-group-box-items.js +1 -1
- package/dist/grid.d.ts +9 -9
- package/dist/grid.js +11 -11
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/license/index.d.ts +1 -0
- package/dist/license/index.js +1 -0
- package/dist/license/license.d.ts +3 -0
- package/dist/license/license.js +215 -0
- package/dist/license/md5-hash.d.ts +9 -0
- package/dist/license/md5-hash.js +167 -0
- package/dist/license.js +1 -1
- package/dist/listbox/item.js +1 -1
- package/dist/listbox/panel.js +2 -2
- package/dist/row-data-source-client/filter/compute-filtered-rows.js +1 -1
- package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.js +1 -1
- package/dist/row-data-source-client/use-client-data-source-paginated.js +3 -2
- package/dist/row-data-source-client/use-client-data-source.js +3 -2
- package/dist/row-data-source-client/use-client-tree-data-source.js +3 -2
- package/dist/row-data-source-server/server-data.js +1 -1
- package/dist/row-data-source-server/use-server-data-source.js +2 -2
- package/dist/sort-manager/hooks/use-sort-manager.js +2 -2
- package/dist/sort-manager/hooks/use-sort-row-item.js +1 -1
- package/dist/sort-manager/sort-add.d.ts +1 -1
- package/dist/sort-manager/sort-add.js +1 -1
- package/dist/sort-manager/sort-apply.d.ts +1 -1
- package/dist/sort-manager/sort-apply.js +2 -2
- package/dist/sort-manager/sort-cancel.d.ts +1 -1
- package/dist/sort-manager/sort-cancel.js +2 -2
- package/dist/sort-manager/sort-clear.d.ts +1 -1
- package/dist/sort-manager/sort-clear.js +1 -1
- package/dist/sort-manager/sort-column-select.d.ts +1 -1
- package/dist/sort-manager/sort-column-select.js +1 -1
- package/dist/sort-manager/sort-direction-select.d.ts +1 -1
- package/dist/sort-manager/sort-direction-select.js +1 -1
- package/dist/sort-manager/sort-remove.d.ts +1 -1
- package/dist/sort-manager/sort-remove.js +1 -1
- package/dist/sort-manager/sort-value-select.d.ts +1 -1
- package/dist/sort-manager/sort-value-select.js +1 -1
- package/dist/state/+types.d.ts +2 -1
- package/dist/state/api/column-field.js +1 -1
- package/dist/state/api/edit-begin.js +1 -1
- package/dist/state/api/focus-cell.js +1 -1
- package/dist/state/api/position-from-element.d.ts +5 -2
- package/dist/state/api/position-from-element.js +3 -3
- package/dist/state/api/row-handle-select.js +1 -1
- package/dist/state/api/use-row-drag.js +3 -2
- package/dist/state/helpers/column-add-row-group.js +1 -1
- package/dist/state/helpers/column-marker.js +1 -1
- package/dist/state/use-lytenyte.js +18 -3
- package/dist/tree-view/branch/branch.d.ts +1 -1
- package/dist/tree-view/branch/branch.js +1 -1
- package/dist/tree-view/branch/use-branch-keys.js +2 -2
- package/dist/tree-view/leaf.js +1 -1
- package/dist/tree-view/panel/make-handle-navigation.js +1 -1
- package/dist/tree-view/panel/make-handle-selection.js +1 -1
- package/dist/tree-view/panel/panel.js +2 -2
- package/dist/tree-view/panel/use-tree-navigation.js +1 -1
- package/dist/tree-view/root.js +1 -1
- package/dist/tree-view/utils/get-focusable-nodes.js +1 -1
- package/dist/tree-view/utils/get-focused-node.js +1 -1
- package/dist/tree-view/utils/get-sibling-branches.js +1 -1
- package/dist/tree-view/virtualized/use-row-start-and-end.d.ts +1 -1
- package/dist/tree-view/virtualized/use-row-start-and-end.js +1 -1
- package/dist/tree-view/virtualized/use-virtualized-tree.js +1 -1
- package/dist/types/types.d.ts +6 -6
- package/package.json +3 -7
- package/dist/__play__/grid-navigation/cell-spans-large.play.d.ts +0 -3
- package/dist/__play__/grid-navigation/cell-spans-large.play.js +0 -26
- package/dist/__play__/grid-navigation/cell-spans-with-pins.play.d.ts +0 -3
- package/dist/__play__/grid-navigation/cell-spans-with-pins.play.js +0 -27
- package/dist/__play__/grid-navigation/cell-spans.play.d.ts +0 -3
- package/dist/__play__/grid-navigation/cell-spans.play.js +0 -52
- package/dist/__play__/grid-navigation/cell-with-tabbables.play.d.ts +0 -3
- package/dist/__play__/grid-navigation/cell-with-tabbables.play.js +0 -47
- package/dist/__play__/grid-navigation/column-groups.play.d.ts +0 -3
- package/dist/__play__/grid-navigation/column-groups.play.js +0 -24
- package/dist/__play__/grid-navigation/full-width-rows.play.d.ts +0 -6
- package/dist/__play__/grid-navigation/full-width-rows.play.js +0 -67
- package/dist/__play__/grid-navigation/horizontal-navigation.pt.d.ts +0 -1
- package/dist/__play__/grid-navigation/horizontal-navigation.pt.js +0 -877
- package/dist/__play__/grid-navigation/normal-layout.play.d.ts +0 -10
- package/dist/__play__/grid-navigation/pinned-gap-layout.play.d.ts +0 -3
- package/dist/__play__/grid-navigation/pinned-gap-layout.play.js +0 -11
- package/dist/__play__/grid-navigation/row-detail-with-spans.play.d.ts +0 -6
- package/dist/__play__/grid-navigation/row-detail-with-spans.play.js +0 -79
- package/dist/__play__/grid-navigation/row-detail.play.d.ts +0 -6
- package/dist/__play__/grid-navigation/row-detail.play.js +0 -78
- package/dist/__play__/grid-navigation/row-detail.pt.d.ts +0 -1
- package/dist/__play__/grid-navigation/row-detail.pt.js +0 -68
- package/dist/__play__/grid-navigation/vertical-navigation.pt.d.ts +0 -1
- package/dist/__play__/grid-navigation/vertical-navigation.pt.js +0 -176
- package/dist/cells/+types.cell.d.ts +0 -13
- package/dist/cells/+types.cell.js +0 -1
- package/dist/cells/cell-default.d.ts +0 -2
- package/dist/cells/cell-default.js +0 -8
- package/dist/cells/cell-editor.d.ts +0 -6
- package/dist/cells/cell-editor.js +0 -110
- package/dist/cells/cell-spacer.d.ts +0 -9
- package/dist/cells/cell-spacer.js +0 -39
- package/dist/cells/cell.d.ts +0 -5
- package/dist/cells/cell.js +0 -44
- package/dist/cells/use-cell-style.d.ts +0 -3
- package/dist/cells/use-cell-style.js +0 -51
- package/dist/header/header-cell.d.ts +0 -10
- package/dist/header/header-cell.js +0 -22
- package/dist/header/header-group-cell.d.ts +0 -5
- package/dist/header/header-group-cell.js +0 -16
- package/dist/header/header-row.d.ts +0 -4
- package/dist/header/header-row.js +0 -10
- package/dist/header/header.d.ts +0 -1
- package/dist/header/header.js +0 -12
- package/dist/header/resize-handler.d.ts +0 -12
- package/dist/header/resize-handler.js +0 -136
- package/dist/header/use-drag-move.d.ts +0 -14
- package/dist/header/use-drag-move.js +0 -97
- package/dist/header/use-header-cell-renderer.d.ts +0 -4
- package/dist/header/use-header-cell-renderer.js +0 -37
- package/dist/root/root.js +0 -108
- package/dist/rows/row/context.d.ts +0 -15
- package/dist/rows/row/context.js +0 -14
- package/dist/rows/row/row.d.ts +0 -7
- package/dist/rows/row/row.js +0 -25
- package/dist/rows/row/use-row-context-value.d.ts +0 -6
- package/dist/rows/row/use-row-context-value.js +0 -45
- package/dist/rows/row-detail-row.d.ts +0 -4
- package/dist/rows/row-detail-row.js +0 -47
- package/dist/rows/row-full-width.d.ts +0 -8
- package/dist/rows/row-full-width.js +0 -19
- package/dist/rows/rows-container.d.ts +0 -1
- package/dist/rows/rows-container.js +0 -9
- package/dist/rows/rows-sections.js +0 -27
- package/dist/rows/scrollers/native-scroller.d.ts +0 -2
- package/dist/rows/scrollers/native-scroller.js +0 -4
- package/dist/utils/cycle-sorts.d.ts +0 -2
- package/dist/utils/cycle-sorts.js +0 -16
- package/dist/viewport/begin-editing.d.ts +0 -5
- package/dist/viewport/begin-editing.js +0 -15
- package/dist/viewport/viewport.js +0 -85
- /package/dist/{root → grid}/dialog-driver.d.ts +0 -0
- /package/dist/{root → grid}/dialog-driver.js +0 -0
- /package/dist/{root → grid}/popover-driver.d.ts +0 -0
- /package/dist/{root → grid}/popover-driver.js +0 -0
- /package/dist/{rows → grid}/rows-sections.d.ts +0 -0
- /package/dist/{viewport → grid}/viewport.d.ts +0 -0
package/dist/root/root.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useMemo, useState } from "react";
|
|
3
|
-
import { RootProvider } from "../context.js";
|
|
4
|
-
import { DialogDriver } from "./dialog-driver.js";
|
|
5
|
-
import { PopoverDriver } from "./popover-driver.js";
|
|
6
|
-
import { CellSelectionDriver } from "../cell-selection/cell-selection-driver.js";
|
|
7
|
-
import { hasAValidLicense, licenseState } from "../license.js";
|
|
8
|
-
export function Root({ grid, children, ...events }) {
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
if (hasAValidLicense)
|
|
11
|
-
return;
|
|
12
|
-
const existing = document.getElementById("lng1771-watermark");
|
|
13
|
-
if (existing)
|
|
14
|
-
return;
|
|
15
|
-
const invalidLicenseWatermark = document.createElement("div");
|
|
16
|
-
invalidLicenseWatermark.style.position = "fixed";
|
|
17
|
-
invalidLicenseWatermark.style.bottom = "0px";
|
|
18
|
-
invalidLicenseWatermark.style.insetInlineEnd = "0px";
|
|
19
|
-
invalidLicenseWatermark.style.background = "rgb(255, 167, 167)";
|
|
20
|
-
invalidLicenseWatermark.style.color = "black";
|
|
21
|
-
invalidLicenseWatermark.style.fontSize = "1.2rem";
|
|
22
|
-
invalidLicenseWatermark.style.fontWeight = "bold";
|
|
23
|
-
invalidLicenseWatermark.style.border = "1px solid black";
|
|
24
|
-
invalidLicenseWatermark.style.padding = "16px";
|
|
25
|
-
if (licenseState === "expired")
|
|
26
|
-
invalidLicenseWatermark.innerHTML = `LyteNyte Grid: License key expired. Your license covers earlier versions only.`;
|
|
27
|
-
else if (licenseState === "invalid")
|
|
28
|
-
invalidLicenseWatermark.innerHTML = `LyteNyte Grid: Invalid license key. Please verify the key and try again.`;
|
|
29
|
-
else
|
|
30
|
-
invalidLicenseWatermark.innerHTML = `LyteNyte Grid PRO is being used for evaluation.
|
|
31
|
-
<a href="https://1771Technologies.com/pricing">Click here</a> to secure your license.`;
|
|
32
|
-
document.body.appendChild(invalidLicenseWatermark);
|
|
33
|
-
return () => invalidLicenseWatermark.remove();
|
|
34
|
-
}, []);
|
|
35
|
-
// Add event listeners in the standard react way
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
const ev = Object.entries(events).map(([onName, fn]) => {
|
|
38
|
-
if (!onName.startsWith("on"))
|
|
39
|
-
return;
|
|
40
|
-
const name = onName[2].toLowerCase() + onName.slice(3);
|
|
41
|
-
return grid.api.eventAddListener(name, fn);
|
|
42
|
-
});
|
|
43
|
-
return () => ev.forEach((c) => c?.());
|
|
44
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
|
-
}, [Object.values(events)]);
|
|
46
|
-
const internal = grid.internal;
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
return internal.focusActive.watch(() => {
|
|
49
|
-
const editActive = internal.editActivePos.get();
|
|
50
|
-
if (!editActive)
|
|
51
|
-
return;
|
|
52
|
-
const focus = internal.focusActive.get();
|
|
53
|
-
if (focus?.kind !== "cell") {
|
|
54
|
-
grid.api.editEnd();
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
if (grid.api.editIsCellActive({ rowIndex: focus.rowIndex, column: focus.colIndex }))
|
|
58
|
-
return;
|
|
59
|
-
grid.api.editEnd();
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}, [grid.api, internal.editActivePos, internal.focusActive]);
|
|
63
|
-
const [vp, ref] = useState(null);
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
if (!vp)
|
|
66
|
-
return;
|
|
67
|
-
const controller = new AbortController();
|
|
68
|
-
vp.addEventListener("scroll", () => {
|
|
69
|
-
internal.xScroll.set(Math.abs(vp.scrollLeft));
|
|
70
|
-
internal.yScroll.set(vp.scrollTop);
|
|
71
|
-
}, { signal: controller.signal });
|
|
72
|
-
return () => controller.abort();
|
|
73
|
-
}, [internal.xScroll, internal.yScroll, vp]);
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
grid.state.viewport.set(vp);
|
|
76
|
-
if (!vp)
|
|
77
|
-
return;
|
|
78
|
-
const obs = new ResizeObserver(() => {
|
|
79
|
-
grid.state.viewportHeightOuter.set(vp.offsetHeight);
|
|
80
|
-
grid.state.viewportWidthOuter.set(vp.offsetWidth);
|
|
81
|
-
grid.state.viewportWidthInner.set(vp.clientWidth);
|
|
82
|
-
grid.state.viewportHeightInner.set(vp.clientHeight);
|
|
83
|
-
});
|
|
84
|
-
grid.state.viewportHeightOuter.set(vp.offsetHeight);
|
|
85
|
-
grid.state.viewportWidthOuter.set(vp.offsetWidth);
|
|
86
|
-
grid.state.viewportWidthInner.set(vp.clientWidth);
|
|
87
|
-
grid.state.viewportHeightInner.set(vp.clientHeight);
|
|
88
|
-
obs.observe(vp);
|
|
89
|
-
return () => {
|
|
90
|
-
obs.disconnect();
|
|
91
|
-
};
|
|
92
|
-
}, [
|
|
93
|
-
grid.state.viewport,
|
|
94
|
-
grid.state.viewportHeightInner,
|
|
95
|
-
grid.state.viewportHeightOuter,
|
|
96
|
-
grid.state.viewportWidthInner,
|
|
97
|
-
grid.state.viewportWidthOuter,
|
|
98
|
-
vp,
|
|
99
|
-
]);
|
|
100
|
-
const value = useMemo(() => {
|
|
101
|
-
return {
|
|
102
|
-
ref,
|
|
103
|
-
grid: grid,
|
|
104
|
-
};
|
|
105
|
-
}, [grid]);
|
|
106
|
-
const cellSelectionMode = grid.state.cellSelectionMode.useValue();
|
|
107
|
-
return (_jsxs(RootProvider, { value: value, children: [_jsx(DialogDriver, {}), _jsx(PopoverDriver, {}), cellSelectionMode !== "none" && _jsx(CellSelectionDriver, {}), children] }));
|
|
108
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { CellRendererFn, ColumnBase, RowLayout, RowNode } from "../../+types";
|
|
2
|
-
export interface RowMetaData {
|
|
3
|
-
readonly selected: boolean;
|
|
4
|
-
readonly indeterminate: boolean;
|
|
5
|
-
readonly colBounds: [number, number];
|
|
6
|
-
readonly row: RowNode<any> | null;
|
|
7
|
-
readonly layout: RowLayout<any>;
|
|
8
|
-
readonly xPositions: Uint32Array;
|
|
9
|
-
readonly yPositions: Uint32Array;
|
|
10
|
-
readonly base: ColumnBase<any>;
|
|
11
|
-
readonly renderers: Record<string, CellRendererFn<any>>;
|
|
12
|
-
readonly rtl: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const RowContext: import("react").Context<RowMetaData>;
|
|
15
|
-
export declare const useRowMeta: () => RowMetaData;
|
package/dist/rows/row/context.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from "react";
|
|
2
|
-
export const RowContext = createContext({
|
|
3
|
-
selected: false,
|
|
4
|
-
indeterminate: false,
|
|
5
|
-
colBounds: [0, 0],
|
|
6
|
-
row: null,
|
|
7
|
-
layout: null,
|
|
8
|
-
xPositions: new Uint32Array(),
|
|
9
|
-
yPositions: new Uint32Array(),
|
|
10
|
-
base: null,
|
|
11
|
-
renderers: null,
|
|
12
|
-
rtl: false,
|
|
13
|
-
});
|
|
14
|
-
export const useRowMeta = () => useContext(RowContext);
|
package/dist/rows/row/row.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { RowNormalRowLayout } from "../../+types";
|
|
2
|
-
import { type DropWrapProps } from "@1771technologies/lytenyte-shared";
|
|
3
|
-
export interface RowProps extends Omit<DropWrapProps, "accepted"> {
|
|
4
|
-
readonly row: RowNormalRowLayout<any>;
|
|
5
|
-
readonly accepted?: string[];
|
|
6
|
-
}
|
|
7
|
-
export declare const Row: import("react").NamedExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "onDrag"> & RowProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/rows/row/row.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, memo } from "react";
|
|
3
|
-
import { useGridRoot } from "../../context.js";
|
|
4
|
-
import { RowDetailRow } from "../row-detail-row.js";
|
|
5
|
-
import { RowReact } from "@1771technologies/lytenyte-shared";
|
|
6
|
-
import { useRowContextValue } from "./use-row-context-value.js";
|
|
7
|
-
import { RowContext } from "./context.js";
|
|
8
|
-
import { equal } from "@1771technologies/lytenyte-js-utils";
|
|
9
|
-
import { CellSpacerNoPin } from "../../cells/cell-spacer.js";
|
|
10
|
-
const empty = [];
|
|
11
|
-
const RowImpl = forwardRef(function Rows({ row, ...props }, forwarded) {
|
|
12
|
-
const ctx = useGridRoot().grid;
|
|
13
|
-
const yPos = ctx.state.yPositions.useValue();
|
|
14
|
-
const rowMeta = useRowContextValue(ctx, row, yPos);
|
|
15
|
-
const hasSpans = ctx.internal.hasSpans.useValue();
|
|
16
|
-
const accepted = props.accepted ?? empty;
|
|
17
|
-
return (_jsx(RowContext.Provider, { value: rowMeta, children: _jsxs(RowReact, { ...props, ref: forwarded, accepted: accepted, gridId: ctx.state.gridId.useValue(), rowIndex: row.rowIndex, rowFirstPinBottom: row.rowFirstPinBottom, rowLastPinTop: row.rowLastPinTop, rowIsFocusRow: row.rowIsFocusRow ?? false, rowPin: row.rowPin, topOffset: ctx.view.useValue().rows.rowTopTotalHeight, yPositions: yPos, hasSpans: hasSpans, "data-ln-row-selected": rowMeta.selected, children: [_jsx(CellSpacerNoPin, { xPositions: rowMeta.xPositions }), props.children, _jsx(RowDetailRow, { layout: row })] }) }));
|
|
18
|
-
});
|
|
19
|
-
export const Row = memo(RowImpl, (prev, next) => {
|
|
20
|
-
const { row: rowP, ...propsP } = prev;
|
|
21
|
-
const { row: rowN, ...propsN } = next;
|
|
22
|
-
const { cells: _, ...rowPropsP } = rowP;
|
|
23
|
-
const { cells: __, ...rowPropsN } = rowN;
|
|
24
|
-
return equal(rowPropsN, rowPropsP) && equal(propsP, propsN);
|
|
25
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Grid, RowLayout } from "../../+types.js";
|
|
2
|
-
import type { InternalAtoms } from "../../state/+types.js";
|
|
3
|
-
import type { RowMetaData } from "./context.js";
|
|
4
|
-
export declare function useRowContextValue(grid: Grid<any> & {
|
|
5
|
-
internal: InternalAtoms;
|
|
6
|
-
}, row: RowLayout<any>, yPositions: Uint32Array): RowMetaData;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { useEffect, useMemo, useState } from "react";
|
|
2
|
-
export function useRowContextValue(grid, row, yPositions) {
|
|
3
|
-
const r = row.row.useValue();
|
|
4
|
-
const xPositions = grid.state.xPositions.useValue();
|
|
5
|
-
const [indeterminate, setIndeterminate] = useState(false);
|
|
6
|
-
const [selected, setSelected] = useState(false);
|
|
7
|
-
const colBounds = grid.internal.colBounds.useValue();
|
|
8
|
-
const rtl = grid.state.rtl.useValue();
|
|
9
|
-
const base = grid.state.columnBase.useValue();
|
|
10
|
-
const renderers = grid.state.cellRenderers.useValue();
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
function handleSelection() {
|
|
13
|
-
if (!r)
|
|
14
|
-
return;
|
|
15
|
-
const selectedIds = grid.state.rowSelectedIds.get();
|
|
16
|
-
if (selectedIds.has(r.id))
|
|
17
|
-
setSelected(true);
|
|
18
|
-
else
|
|
19
|
-
setSelected(false);
|
|
20
|
-
if (r.kind === "branch") {
|
|
21
|
-
const childIds = grid.state.rowDataSource.get().rowAllChildIds(r.id);
|
|
22
|
-
setIndeterminate(childIds.some((c) => selectedIds.has(c)) && childIds.some((c) => !selectedIds.has(c)));
|
|
23
|
-
}
|
|
24
|
-
else
|
|
25
|
-
setIndeterminate(false);
|
|
26
|
-
}
|
|
27
|
-
handleSelection();
|
|
28
|
-
return grid.state.rowSelectedIds.watch(() => handleSelection());
|
|
29
|
-
}, [grid.state.rowDataSource, grid.state.rowSelectedIds, r]);
|
|
30
|
-
const value = useMemo(() => {
|
|
31
|
-
return {
|
|
32
|
-
selected,
|
|
33
|
-
indeterminate,
|
|
34
|
-
colBounds,
|
|
35
|
-
row: r,
|
|
36
|
-
layout: row,
|
|
37
|
-
xPositions,
|
|
38
|
-
yPositions,
|
|
39
|
-
rtl,
|
|
40
|
-
base,
|
|
41
|
-
renderers,
|
|
42
|
-
};
|
|
43
|
-
}, [base, colBounds, indeterminate, r, renderers, row, rtl, selected, xPositions, yPositions]);
|
|
44
|
-
return value;
|
|
45
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { SCROLL_WIDTH_VARIABLE_USE, sizeFromCoord } from "@1771technologies/lytenyte-shared";
|
|
3
|
-
import { useGridRoot } from "../context.js";
|
|
4
|
-
import { useEffect, useState } from "react";
|
|
5
|
-
export function RowDetailRow({ layout, }) {
|
|
6
|
-
const cx = useGridRoot();
|
|
7
|
-
const row = layout.row.useValue();
|
|
8
|
-
if (!row || !cx.grid.api.rowDetailIsExpanded(row))
|
|
9
|
-
return null;
|
|
10
|
-
return _jsx(RowDetailImpl, { row: row, rowIndex: layout.rowIndex });
|
|
11
|
-
}
|
|
12
|
-
function RowDetailImpl({ row, rowIndex }) {
|
|
13
|
-
const cx = useGridRoot();
|
|
14
|
-
const rtl = cx.grid.state.rtl.useValue();
|
|
15
|
-
const height = cx.grid.api.rowDetailRenderedHeight(row);
|
|
16
|
-
const rowHeight = sizeFromCoord(rowIndex, cx.grid.state.yPositions.get()) - height;
|
|
17
|
-
const Renderer = cx.grid.state.rowDetailRenderer.useValue().fn;
|
|
18
|
-
const [ref, setRef] = useState(null);
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
const first = ref?.firstElementChild;
|
|
21
|
-
if (!first)
|
|
22
|
-
return;
|
|
23
|
-
const obs = new ResizeObserver(() => {
|
|
24
|
-
cx.grid.internal.rowDetailAutoHeightCache.set((prev) => ({
|
|
25
|
-
...prev,
|
|
26
|
-
[rowIndex]: first.offsetHeight,
|
|
27
|
-
}));
|
|
28
|
-
});
|
|
29
|
-
obs.observe(first);
|
|
30
|
-
return () => obs.disconnect();
|
|
31
|
-
}, [cx.grid.internal.rowDetailAutoHeightCache, ref?.firstElementChild, rowIndex]);
|
|
32
|
-
const isAuto = cx.grid.state.rowDetailHeight.useValue() === "auto";
|
|
33
|
-
return (_jsx("div", { ref: setRef, role: "gridcell", style: {
|
|
34
|
-
pointerEvents: "none",
|
|
35
|
-
position: "absolute",
|
|
36
|
-
left: 0,
|
|
37
|
-
width: SCROLL_WIDTH_VARIABLE_USE,
|
|
38
|
-
}, children: _jsx("div", { tabIndex: 0, "data-ln-gridid": cx.grid.state.gridId.get(), "data-ln-row-detail": true, "data-ln-rowindex": rowIndex, style: {
|
|
39
|
-
position: "sticky",
|
|
40
|
-
pointerEvents: "all",
|
|
41
|
-
right: rtl ? "0px" : undefined,
|
|
42
|
-
left: rtl ? undefined : "0px",
|
|
43
|
-
marginTop: rowHeight,
|
|
44
|
-
width: cx.grid.state.viewportWidthInner.useValue(),
|
|
45
|
-
height: isAuto ? "auto" : height,
|
|
46
|
-
}, children: _jsx(Renderer, { grid: cx.grid, row: row, rowIndex: rowIndex }) }) }));
|
|
47
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { RowFullWidthRowLayout } from "../+types";
|
|
2
|
-
import { type DropWrapProps } from "@1771technologies/lytenyte-shared";
|
|
3
|
-
export interface RowFullWidthProps extends Omit<DropWrapProps, "accepted"> {
|
|
4
|
-
readonly row: RowFullWidthRowLayout<any>;
|
|
5
|
-
readonly space?: "viewport" | "scroll-width";
|
|
6
|
-
readonly accepted?: string[];
|
|
7
|
-
}
|
|
8
|
-
export declare const RowFullWidth: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & RowFullWidthProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { fastDeepMemo } from "@1771technologies/lytenyte-react-hooks";
|
|
4
|
-
import { useGridRoot } from "../context.js";
|
|
5
|
-
import { RowFullWidthReact } from "@1771technologies/lytenyte-shared";
|
|
6
|
-
import { RowDetailRow } from "./row-detail-row.js";
|
|
7
|
-
import { useRowContextValue } from "./row/use-row-context-value.js";
|
|
8
|
-
const empty = [];
|
|
9
|
-
const RowFullWidthImpl = forwardRef(function RowFullWidth({ row: layout, space, children, ...props }, forwarded) {
|
|
10
|
-
const grid = useGridRoot().grid;
|
|
11
|
-
const Renderer = grid.state.rowFullWidthRenderer.useValue().fn;
|
|
12
|
-
const row = layout.row.useValue();
|
|
13
|
-
const yPositions = grid.state.yPositions.useValue();
|
|
14
|
-
const hasSpans = grid.internal.hasSpans.useValue();
|
|
15
|
-
const meta = useRowContextValue(grid, layout, yPositions);
|
|
16
|
-
return (_jsx(RowFullWidthReact, { ...props, ref: forwarded, accepted: props.accepted ?? empty, detail: _jsx(RowDetailRow, { layout: layout }), detailHeight: grid.api.rowDetailRenderedHeight(row ?? ""), gridId: grid.state.gridId.useValue(), rtl: meta.rtl, hasSpans: hasSpans, rowFirstPinBottom: layout.rowFirstPinBottom, rowLastPinTop: layout.rowLastPinTop, rowIndex: layout.rowIndex, rowIsFocusRow: layout.rowIsFocusRow ?? false, rowPin: layout.rowPin, topOffset: grid.view.useValue().rows.rowTopTotalHeight, yPositions: yPositions, space: space, "data-ln-row-selected": meta.selected, children: children ??
|
|
17
|
-
(row ? (_jsx(Renderer, { grid: grid, row: row, rowIndex: layout.rowIndex, rowSelected: meta.selected, rowIndeterminate: meta.indeterminate })) : null) }));
|
|
18
|
-
});
|
|
19
|
-
export const RowFullWidth = fastDeepMemo(RowFullWidthImpl);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const RowsContainer: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { useGridRoot } from "../context.js";
|
|
4
|
-
import { fastDeepMemo } from "@1771technologies/lytenyte-react-hooks";
|
|
5
|
-
import { RowsContainerReact } from "@1771technologies/lytenyte-shared";
|
|
6
|
-
export const RowsContainer = fastDeepMemo(forwardRef(function Rows(props, forwarded) {
|
|
7
|
-
const ctx = useGridRoot().grid;
|
|
8
|
-
return (_jsx(RowsContainerReact, { ...props, ref: forwarded, height: ctx.state.heightTotal.useValue(), width: ctx.state.widthTotal.useValue(), viewportHeight: ctx.state.viewportHeightInner.useValue(), viewportWidth: ctx.state.viewportWidthInner.useValue() }));
|
|
9
|
-
}));
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { fastDeepMemo } from "@1771technologies/lytenyte-react-hooks";
|
|
4
|
-
import { useGridRoot } from "../context.js";
|
|
5
|
-
import { NativeScroller } from "./scrollers/native-scroller.js";
|
|
6
|
-
import { RowsBottomReact, RowsCenterReact, RowsTopReact } from "@1771technologies/lytenyte-shared";
|
|
7
|
-
import { CellSelectionBottom, CellSelectionCenter, CellSelectionTop, } from "../cell-selection/cell-selection-containers.js";
|
|
8
|
-
export const RowsTop = fastDeepMemo(forwardRef(function RowsTop(props, forwarded) {
|
|
9
|
-
const cx = useGridRoot().grid;
|
|
10
|
-
const view = cx.view.useValue().rows;
|
|
11
|
-
const topCount = cx.state.rowDataStore.rowTopCount.useValue();
|
|
12
|
-
return (_jsxs(RowsTopReact, { ...props, rowFirst: topCount || -1, rowLast: topCount, ref: forwarded, top: cx.internal.headerHeightTotal.useValue(), height: view.rowTopTotalHeight, children: [props.children, _jsx(CellSelectionTop, {})] }));
|
|
13
|
-
}));
|
|
14
|
-
export const RowsCenter = fastDeepMemo(forwardRef(function RowsCenter({ children, ...props }, forwarded) {
|
|
15
|
-
const cx = useGridRoot().grid;
|
|
16
|
-
const view = cx.view.useValue().rows;
|
|
17
|
-
const rowCenterCount = cx.state.rowDataStore.rowCenterCount.useValue();
|
|
18
|
-
return (_jsx(RowsCenterReact, { ...props, ref: forwarded, rowFirst: cx.state.rowDataStore.rowTopCount.useValue(), rowLast: rowCenterCount + cx.state.rowDataStore.rowTopCount.useValue(), height: view.rowCenterTotalHeight, pinSectionHeights: view.rowBottomTotalHeight + view.rowTopTotalHeight, children: _jsxs(NativeScroller, { children: [_jsx(CellSelectionCenter, {}), children] }) }));
|
|
19
|
-
}));
|
|
20
|
-
export const RowsBottom = fastDeepMemo(forwardRef(function RowsBottom(props, forwarded) {
|
|
21
|
-
const cx = useGridRoot().grid;
|
|
22
|
-
const view = cx.view.useValue().rows;
|
|
23
|
-
const rowCenterCount = cx.state.rowDataStore.rowCenterCount.useValue();
|
|
24
|
-
const rowTopCount = cx.state.rowDataStore.rowTopCount.useValue();
|
|
25
|
-
const rowBottomCount = cx.state.rowDataStore.rowBottomCount.useValue();
|
|
26
|
-
return (_jsxs(RowsBottomReact, { ...props, ref: forwarded, rowFirst: rowCenterCount + rowTopCount, rowLast: rowCenterCount + rowBottomCount + rowTopCount, height: view.rowBottomTotalHeight, children: [_jsx(CellSelectionBottom, {}), props.children] }));
|
|
27
|
-
}));
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export function cycleSorts(grid, column) {
|
|
2
|
-
const current = grid.api.sortForColumn(column.id);
|
|
3
|
-
if (current) {
|
|
4
|
-
if (current.sort.isDescending)
|
|
5
|
-
grid.state.sortModel.set([]);
|
|
6
|
-
else
|
|
7
|
-
grid.state.sortModel.set([
|
|
8
|
-
{ columnId: column.id, sort: { kind: "string" }, isDescending: true },
|
|
9
|
-
]);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
grid.state.sortModel.set([
|
|
13
|
-
{ columnId: column.id, sort: { kind: "string" }, isDescending: false },
|
|
14
|
-
]);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export function beginEditing(grid, activator, init) {
|
|
2
|
-
const focusPos = grid.internal.focusActive.get();
|
|
3
|
-
const editMode = grid.state.editCellMode.get();
|
|
4
|
-
const editActivator = grid.state.editClickActivator.get();
|
|
5
|
-
if (focusPos?.kind !== "cell" || editMode === "readonly")
|
|
6
|
-
return;
|
|
7
|
-
if (activator && editActivator !== activator)
|
|
8
|
-
return;
|
|
9
|
-
const column = grid.api.columnByIndex(focusPos.colIndex);
|
|
10
|
-
if (!column)
|
|
11
|
-
return;
|
|
12
|
-
if (grid.api.editIsCellActive({ column, rowIndex: focusPos.rowIndex }))
|
|
13
|
-
return;
|
|
14
|
-
grid.api.editBegin({ column, rowIndex: focusPos.rowIndex, init });
|
|
15
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { useCombinedRefs } from "@1771technologies/lytenyte-react-hooks";
|
|
4
|
-
import { useGridRoot } from "../context.js";
|
|
5
|
-
import { handleNavigation, useFocusTracking } from "@1771technologies/lytenyte-shared";
|
|
6
|
-
import { beginEditing } from "./begin-editing.js";
|
|
7
|
-
export const Viewport = forwardRef(function Viewport({ children, style, ...props }, forwarded) {
|
|
8
|
-
const ctx = useGridRoot();
|
|
9
|
-
const ref = useCombinedRefs(ctx.ref, forwarded);
|
|
10
|
-
const vp = ctx.grid.state.viewport.useValue();
|
|
11
|
-
const width = ctx.grid.state.widthTotal.useValue();
|
|
12
|
-
const height = ctx.grid.state.heightTotal.useValue();
|
|
13
|
-
const rtl = ctx.grid.state.rtl.useValue();
|
|
14
|
-
const cellSelectionMode = ctx.grid.state.cellSelectionMode.useValue();
|
|
15
|
-
const [focused, vpFocused] = useFocusTracking(vp, ctx.grid.internal.focusActive);
|
|
16
|
-
const shouldCapture = !focused && !vpFocused;
|
|
17
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { tabIndex: 0, ...props, "data-ln-has-cell-selection": cellSelectionMode !== "none", onKeyDown: (e) => {
|
|
18
|
-
props.onKeyDown?.(e);
|
|
19
|
-
if (e.defaultPrevented || e.isPropagationStopped() || !vp)
|
|
20
|
-
return;
|
|
21
|
-
handleNavigation({
|
|
22
|
-
gridId: ctx.grid.state.gridId.get(),
|
|
23
|
-
rtl,
|
|
24
|
-
event: e,
|
|
25
|
-
viewport: vp,
|
|
26
|
-
topCount: ctx.grid.state.rowDataStore.rowTopCount.get(),
|
|
27
|
-
centerCount: ctx.grid.state.rowDataStore.rowCenterCount.get(),
|
|
28
|
-
getRootCell: ctx.grid.api.cellRoot,
|
|
29
|
-
scrollIntoView: ctx.grid.api.scrollIntoView,
|
|
30
|
-
focusActive: ctx.grid.internal.focusActive,
|
|
31
|
-
columnCount: ctx.grid.state.columnMeta.get().columnsVisible.length,
|
|
32
|
-
rowCount: ctx.grid.state.rowDataStore.rowCount.get(),
|
|
33
|
-
isRowDetailExpanded: (r) => {
|
|
34
|
-
const row = ctx.grid.api.rowByIndex(r);
|
|
35
|
-
if (!row)
|
|
36
|
-
return false;
|
|
37
|
-
return ctx.grid.api.rowDetailIsExpanded(row);
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
if (e.key === "Enter" || e.key.length === 1) {
|
|
41
|
-
// We use a timeout to avoid setting the value on clicks. This can happen when a user types
|
|
42
|
-
// a non-printable key.
|
|
43
|
-
setTimeout(() => {
|
|
44
|
-
beginEditing(ctx.grid, undefined, e.key === "Enter" ? undefined : e.key);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
if (e.key === "Backspace" || e.key === "Delete") {
|
|
48
|
-
const focusPos = ctx.grid.internal.focusActive.get();
|
|
49
|
-
if (focusPos?.kind === "cell")
|
|
50
|
-
ctx.grid.api.editUpdate({
|
|
51
|
-
column: focusPos.colIndex,
|
|
52
|
-
rowIndex: focusPos.rowIndex,
|
|
53
|
-
value: null,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}, onClick: (e) => {
|
|
57
|
-
props.onClick?.(e);
|
|
58
|
-
if (e.defaultPrevented)
|
|
59
|
-
return;
|
|
60
|
-
beginEditing(ctx.grid, "single");
|
|
61
|
-
if (ctx.grid.state.rowSelectionActivator.get() === "single-click")
|
|
62
|
-
ctx.grid.api.rowHandleSelect(e);
|
|
63
|
-
}, onDoubleClick: (e) => {
|
|
64
|
-
props.onDoubleClick?.(e);
|
|
65
|
-
if (e.defaultPrevented)
|
|
66
|
-
return;
|
|
67
|
-
beginEditing(ctx.grid, "double-click");
|
|
68
|
-
if (ctx.grid.state.rowSelectionActivator.get() === "double-click")
|
|
69
|
-
ctx.grid.api.rowHandleSelect(e);
|
|
70
|
-
}, role: "grid", ref: ref, "data-ln-viewport": true, style: {
|
|
71
|
-
...style,
|
|
72
|
-
position: "relative",
|
|
73
|
-
display: "flex",
|
|
74
|
-
flexDirection: "column",
|
|
75
|
-
contain: "strict",
|
|
76
|
-
width: "100%",
|
|
77
|
-
height: "100%",
|
|
78
|
-
overflow: style?.overflow ?? "auto",
|
|
79
|
-
direction: rtl ? "rtl" : "ltr",
|
|
80
|
-
}, children: [vp && children, !vp && _jsx("div", { style: { width, height } })] }), shouldCapture && (_jsx("div", { role: "none", "data-ln-focus-capture": true, onFocusCapture: (e) => {
|
|
81
|
-
e.preventDefault();
|
|
82
|
-
e.stopPropagation();
|
|
83
|
-
vp?.focus();
|
|
84
|
-
}, tabIndex: 0 }))] }));
|
|
85
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|