@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
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {} from "../+types.js";
|
|
2
2
|
import { useRef } from "react";
|
|
3
3
|
import { makeColumnView } from "./helpers/column-view.js";
|
|
4
|
-
import { computeBounds, computeColumnPositions,
|
|
4
|
+
import { computeBounds, computeColumnPositions, computeRowPositions, makeLayoutState, updateFull, } from "@1771technologies/lytenyte-shared";
|
|
5
|
+
import { computed, effect, makeAtom, signal } from "@1771technologies/lytenyte-core/yinternal";
|
|
5
6
|
import { makeRowLayout } from "./helpers/row-layout/row-layout.js";
|
|
6
|
-
import { equal, rangesOverlap } from "@1771technologies/lytenyte-
|
|
7
|
+
import { equal, rangesOverlap } from "@1771technologies/lytenyte-shared";
|
|
7
8
|
import { makeColumnLayout } from "./helpers/column-layout.js";
|
|
8
9
|
import { emptyRowDataSource } from "./helpers/empty-row-data-source.js";
|
|
9
10
|
import { getFullWidthCallback } from "./helpers/get-full-width-callback.js";
|
|
@@ -50,6 +51,7 @@ import { splitCellSelectionRect, } from "../cell-selection/split-cell-selection-
|
|
|
50
51
|
import { boundSelectionRect } from "../cell-selection/bound-selection-rect.js";
|
|
51
52
|
import { makeCellRoot } from "./api/cell-root.js";
|
|
52
53
|
import { splitOnPivot } from "../cell-selection/split-on-pivot.js";
|
|
54
|
+
import { makeRowStore } from "@1771technologies/lytenyte-core/yinternal";
|
|
53
55
|
const EMPTY_POSITION_ARRAY = new Uint32Array();
|
|
54
56
|
const DEFAULT_HEADER_HEIGHT = 40;
|
|
55
57
|
const COLUMN_GROUP_JOIN_DELIMITER = "-->";
|
|
@@ -142,7 +144,9 @@ export function makeLyteNyte(p) {
|
|
|
142
144
|
const internal_cellSelectionAdditive = signal(null);
|
|
143
145
|
const internal_cellSelectionSplits = computed(() => {
|
|
144
146
|
const selections = cellSelections();
|
|
147
|
+
// @ts-expect-error the $() is defined but not typed.
|
|
145
148
|
const topCount = rowDataStore.rowTopCount.$();
|
|
149
|
+
// @ts-expect-error the $() is defined but not typed.
|
|
146
150
|
const centerCount = rowDataStore.rowCenterCount.$();
|
|
147
151
|
const meta = columnMeta();
|
|
148
152
|
const p = internal_cellSelectionPivot();
|
|
@@ -190,8 +194,11 @@ export function makeLyteNyte(p) {
|
|
|
190
194
|
});
|
|
191
195
|
const layoutState = makeLayoutState(0);
|
|
192
196
|
const layoutState$ = computed(() => {
|
|
197
|
+
// @ts-expect-error the $() is defined but not typed.
|
|
193
198
|
rowDataStore.rowBottomCount.$();
|
|
199
|
+
// @ts-expect-error the $() is defined but not typed.
|
|
194
200
|
rowDataStore.rowCenterCount.$();
|
|
201
|
+
// @ts-expect-error the $() is defined but not typed.
|
|
195
202
|
rowDataStore.rowTopCount.$();
|
|
196
203
|
rowDataSource();
|
|
197
204
|
rowDetailExpansions();
|
|
@@ -203,6 +210,7 @@ export function makeLyteNyte(p) {
|
|
|
203
210
|
columnPivotModel();
|
|
204
211
|
columns();
|
|
205
212
|
columnPivotColumns();
|
|
213
|
+
// @ts-expect-error the $() is defined but not typed.
|
|
206
214
|
const rowCount = rowDataStore.rowCount.$();
|
|
207
215
|
const columnCount = columnCount$();
|
|
208
216
|
if (rowCount > layoutState.computed.length || columnCount != layoutState.base.length) {
|
|
@@ -225,7 +233,9 @@ export function makeLyteNyte(p) {
|
|
|
225
233
|
const scrollLeft = xScroll();
|
|
226
234
|
const xPos = xPositions();
|
|
227
235
|
const yPos = yPositions();
|
|
236
|
+
// @ts-expect-error the $() is defined but not typed.
|
|
228
237
|
const topCount = rowDataStore.rowTopCount.$();
|
|
238
|
+
// @ts-expect-error the $() is defined but not typed.
|
|
229
239
|
const bottomCount = rowDataStore.rowBottomCount.$();
|
|
230
240
|
const start = startCount();
|
|
231
241
|
const end = endCount();
|
|
@@ -382,6 +392,7 @@ export function makeLyteNyte(p) {
|
|
|
382
392
|
filterModel();
|
|
383
393
|
rowGroupModel();
|
|
384
394
|
columnPivotModel();
|
|
395
|
+
// @ts-expect-error the $() is defined but not typed.
|
|
385
396
|
const rowCount = rowDataStore.rowCount.$();
|
|
386
397
|
const innerHeight = viewportHeightInner();
|
|
387
398
|
const detailExpansions = rowDetailExpansions();
|
|
@@ -428,8 +439,11 @@ export function makeLyteNyte(p) {
|
|
|
428
439
|
const columns = columnMeta().columnsVisible;
|
|
429
440
|
const rds = rowDataSource();
|
|
430
441
|
const { layout, cache } = layoutState$();
|
|
442
|
+
// @ts-expect-error the $() is defined but not typed.
|
|
431
443
|
const topCount = rowDataStore.rowTopCount.$();
|
|
444
|
+
// @ts-expect-error the $() is defined but not typed.
|
|
432
445
|
const botCount = rowDataStore.rowBottomCount.$();
|
|
446
|
+
// @ts-expect-error the $() is defined but not typed.
|
|
433
447
|
const rowCount = rowDataStore.rowCount.$();
|
|
434
448
|
const expansions = rowDetailExpansions();
|
|
435
449
|
const fullWidthPredicate = rowFullWidthPredicate().fn;
|
|
@@ -615,7 +629,7 @@ export function makeLyteNyte(p) {
|
|
|
615
629
|
dialogFrameOpen: makeDialogFrameOpen(grid),
|
|
616
630
|
popoverFrameClose: makePopoverFrameClose(grid),
|
|
617
631
|
popoverFrameOpen: makePopoverFrameOpen(grid),
|
|
618
|
-
positionFromElement: makePositionFromElement(),
|
|
632
|
+
positionFromElement: makePositionFromElement(grid),
|
|
619
633
|
});
|
|
620
634
|
Object.assign(grid, {
|
|
621
635
|
internal: {
|
|
@@ -654,6 +668,7 @@ export function makeLyteNyte(p) {
|
|
|
654
668
|
rowDataSource.set(p.rowDataSource ?? emptyRowDataSource);
|
|
655
669
|
// Ensure cell selections are bounded.
|
|
656
670
|
effect(() => {
|
|
671
|
+
// @ts-expect-error the $() is defined but not typed.
|
|
657
672
|
rowDataStore.rowCount.$();
|
|
658
673
|
columnMeta();
|
|
659
674
|
const selections = cellSelections();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useEffect } from "react";
|
|
3
3
|
import { depthContext, useDepth } from "../depth-provider.js";
|
|
4
|
-
import { useEvent, useSlot, useTransitionedOpen, } from "@1771technologies/lytenyte-react-hooks";
|
|
5
4
|
import { useTreeRoot } from "../context.js";
|
|
6
5
|
import { useBranchKeys } from "./use-branch-keys.js";
|
|
6
|
+
import { useEvent, useSlot, useTransitionedOpen, } from "@1771technologies/lytenyte-core/yinternal";
|
|
7
7
|
export const TreeBranch = forwardRef(function TreeBranch({ itemId, label, expander, transitionEnterMs, transitionExitMs, gridWrapped, labelWrap, ...props }, forwarded) {
|
|
8
8
|
const depth = useDepth();
|
|
9
9
|
const root = useTreeRoot();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useEvent } from "@1771technologies/lytenyte-react-hooks";
|
|
2
1
|
import { useTreeRoot } from "../context.js";
|
|
3
2
|
import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
|
|
4
3
|
import { getFocusedNode } from "../utils/get-focused-node.js";
|
|
@@ -6,7 +5,8 @@ import { isBranchNode } from "../utils/is-branch-node.js";
|
|
|
6
5
|
import { getTreeNodeId } from "../utils/get-tree-node-id.js";
|
|
7
6
|
import { getParentNode } from "../utils/get-parent-node.js";
|
|
8
7
|
import { getSiblingBranches } from "../utils/get-sibling-branches.js";
|
|
9
|
-
import { getFocusables } from "@1771technologies/lytenyte-
|
|
8
|
+
import { getFocusables } from "@1771technologies/lytenyte-shared";
|
|
9
|
+
import { useEvent } from "@1771technologies/lytenyte-core/yinternal";
|
|
10
10
|
const accepted = ["ArrowRight", "ArrowLeft", "Enter", "*"];
|
|
11
11
|
export function useBranchKeys(id, defaultExpansion, current) {
|
|
12
12
|
const ctx = useTreeRoot();
|
package/dist/tree-view/leaf.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { useDepth } from "./depth-provider.js";
|
|
4
4
|
import { useTreeRoot } from "./context.js";
|
|
5
|
-
import { getFocusables } from "@1771technologies/lytenyte-
|
|
5
|
+
import { getFocusables } from "@1771technologies/lytenyte-shared";
|
|
6
6
|
export const TreeLeaf = forwardRef(function TreeLeaf({ itemId, ...props }, forwarded) {
|
|
7
7
|
const depth = useDepth();
|
|
8
8
|
const root = useTreeRoot();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isInView } from "@1771technologies/lytenyte-
|
|
1
|
+
import { isInView } from "@1771technologies/lytenyte-shared";
|
|
2
2
|
import { getFirstNode } from "../navigation/get-first-node.js";
|
|
3
3
|
import { getLastNode } from "../navigation/get-last-node.js";
|
|
4
4
|
import { getNextNode } from "../navigation/get-next-node.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isInView } from "@1771technologies/lytenyte-
|
|
1
|
+
import { isInView } from "@1771technologies/lytenyte-shared";
|
|
2
2
|
import { getFirstNode } from "../navigation/get-first-node.js";
|
|
3
3
|
import { getLastNode } from "../navigation/get-last-node.js";
|
|
4
4
|
import { getNextNode } from "../navigation/get-next-node.js";
|
|
@@ -2,13 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, useRef } from "react";
|
|
3
3
|
import { depthContext } from "../depth-provider.js";
|
|
4
4
|
import { useTreeRoot } from "../context.js";
|
|
5
|
-
import { useForkRef } from "@1771technologies/lytenyte-react-hooks";
|
|
6
5
|
import { useTreeNavigation } from "./use-tree-navigation.js";
|
|
7
6
|
import { getFocusedNode } from "../utils/get-focused-node.js";
|
|
8
7
|
import { getFirstNode } from "../navigation/get-first-node.js";
|
|
8
|
+
import { useCombinedRefs } from "@1771technologies/lytenyte-core/yinternal";
|
|
9
9
|
export const TreePanel = forwardRef(function TreePanel(props, forwarded) {
|
|
10
10
|
const ctx = useTreeRoot();
|
|
11
|
-
const ref =
|
|
11
|
+
const ref = useCombinedRefs(ctx.panelRef, forwarded);
|
|
12
12
|
const focused = useTreeNavigation();
|
|
13
13
|
const focusTime = useRef(null);
|
|
14
14
|
return (_jsxs(depthContext.Provider, { value: 0, children: [_jsx("ul", { ...props, role: "tree", ref: ref, tabIndex: focused ? -1 : 0, "aria-multiselectable": ctx.selectionMode === "multiple", "aria-orientation": "vertical", "data-ln-tree-panel": true, onFocus: () => {
|
|
@@ -5,7 +5,7 @@ import { makeHandleTypeahead } from "./make-handle-typeahead.js";
|
|
|
5
5
|
import { makeHandleNavigation } from "./make-handle-navigation.js";
|
|
6
6
|
import { makeHandleSelection } from "./make-handle-selection.js";
|
|
7
7
|
import { getTreeNodeId } from "../utils/get-tree-node-id.js";
|
|
8
|
-
import { getTabbables } from "@1771technologies/lytenyte-
|
|
8
|
+
import { getTabbables } from "@1771technologies/lytenyte-shared";
|
|
9
9
|
export function useTreeNavigation() {
|
|
10
10
|
const ctx = useTreeRoot();
|
|
11
11
|
const [focused, setFocused] = useState(false);
|
package/dist/tree-view/root.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { context } from "./context.js";
|
|
4
|
-
import { useCombinedRefs, useEvent } from "@1771technologies/lytenyte-react-hooks";
|
|
5
4
|
import { getAllIds } from "./navigation/get-all-ids.js";
|
|
6
5
|
import { getIdsBetweenNodes } from "./utils/get-ids-between-nodes.js";
|
|
6
|
+
import { useCombinedRefs, useEvent } from "@1771technologies/lytenyte-core/yinternal";
|
|
7
7
|
export const TreeRoot = forwardRef((p, forwarded) => {
|
|
8
8
|
const [panel, setPanel] = useState(null);
|
|
9
9
|
const [expansions, onExpansionChange] = useState({});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getFocusables, isHTMLElement } from "@1771technologies/lytenyte-
|
|
1
|
+
import { getFocusables, isHTMLElement } from "@1771technologies/lytenyte-shared";
|
|
2
2
|
export function getFocusableNodes(panel) {
|
|
3
3
|
const focusNodes = getFocusables(panel).filter((c) => isHTMLElement(c) && c.getAttribute("data-ln-tree-node") === "true");
|
|
4
4
|
return focusNodes;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isHTMLElement } from "@1771technologies/lytenyte-
|
|
1
|
+
import { isHTMLElement } from "@1771technologies/lytenyte-shared";
|
|
2
2
|
import { isBranchNode } from "./is-branch-node.js";
|
|
3
3
|
export function getSiblingBranches(el) {
|
|
4
4
|
const children = el.parentElement?.children;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { RectReadOnly } from "@1771technologies/lytenyte-
|
|
1
|
+
import type { RectReadOnly } from "@1771technologies/lytenyte-core/yinternal";
|
|
2
2
|
export declare function useRowStartAndEnd(panel: HTMLElement | null | undefined, itemHeight: number, bounds: RectReadOnly, size: number): number[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { clamp } from "@1771technologies/lytenyte-
|
|
1
|
+
import { clamp } from "@1771technologies/lytenyte-shared";
|
|
2
2
|
import { useEffect, useMemo, useState } from "react";
|
|
3
3
|
export function useRowStartAndEnd(panel, itemHeight, bounds, size) {
|
|
4
4
|
const [startOffset, setStartOffset] = useState(0);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import {} from "@1771technologies/lytenyte-shared";
|
|
3
|
-
import { useEvent, useMeasure } from "@1771technologies/lytenyte-react-hooks";
|
|
4
3
|
import { useMemo, useState } from "react";
|
|
5
4
|
import { buildVirtualTreePartial } from "./get-virtual-tree-paths.js";
|
|
6
5
|
import { makeVirtualTree } from "./make-virtual-tree.js";
|
|
7
6
|
import { useFlattenedTree } from "./use-flattened-tree.js";
|
|
8
7
|
import { useRowStartAndEnd } from "./use-row-start-and-end.js";
|
|
9
8
|
import { getTreeNodeId } from "../utils/get-tree-node-id.js";
|
|
9
|
+
import { useEvent, useMeasure } from "@1771technologies/lytenyte-core/yinternal";
|
|
10
10
|
export function useVirtualizedTree({ itemHeight, expansions, expansionDefault = false, nonAdjacentPathTrees, paths, }) {
|
|
11
11
|
const [ref, bounds, _, panel] = useMeasure({ scroll: true });
|
|
12
12
|
const { flat, nodeToIndex, indexToId, allIds, idToNode, root } = useFlattenedTree(paths, expansions, expansionDefault, nonAdjacentPathTrees);
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type * from "../+types";
|
|
2
|
-
export type { CellProps } from "../
|
|
3
|
-
export type { HeaderCellProps } from "../
|
|
4
|
-
export type {
|
|
5
|
-
export type {
|
|
6
|
-
export type { RootProps } from "../
|
|
7
|
-
export type { RowFullWidthProps } from "../
|
|
2
|
+
export type { CellProps } from "../grid/cell";
|
|
3
|
+
export type { HeaderCellProps } from "../grid/header-cell";
|
|
4
|
+
export type { HeaderRowProps } from "../grid/header-row";
|
|
5
|
+
export type { HeaderGroupCellProps } from "../grid/header-group-cell";
|
|
6
|
+
export type { RootProps } from "../grid/root";
|
|
7
|
+
export type { RowFullWidthProps } from "../grid/row-full-width";
|
|
8
8
|
export {};
|
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.
|
|
4
|
+
"version": "1.0.16",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "COMMERCIAL",
|
|
7
7
|
"files": [
|
|
@@ -48,12 +48,8 @@
|
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@1771technologies/lytenyte-core": "1.0.
|
|
52
|
-
"@1771technologies/lytenyte-
|
|
53
|
-
"@1771technologies/lytenyte-shared": "1.0.14",
|
|
54
|
-
"@1771technologies/lytenyte-dom-utils": "1.0.14",
|
|
55
|
-
"@1771technologies/lytenyte-js-utils": "1.0.14",
|
|
56
|
-
"@1771technologies/lytenyte-react-hooks": "1.0.14"
|
|
51
|
+
"@1771technologies/lytenyte-core": "1.0.16",
|
|
52
|
+
"@1771technologies/lytenyte-shared": "1.0.16"
|
|
57
53
|
},
|
|
58
54
|
"peerDependencies": {
|
|
59
55
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import NormalLayout from "./normal-layout.play.js";
|
|
3
|
-
const columns = [
|
|
4
|
-
{
|
|
5
|
-
id: "age",
|
|
6
|
-
colSpan: (c) => {
|
|
7
|
-
return c.rowIndex === 0 ? 10 : 1;
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
{ id: "marital" },
|
|
11
|
-
{ id: "default" },
|
|
12
|
-
{ id: "housing", colSpan: 2 },
|
|
13
|
-
{ id: "loan" },
|
|
14
|
-
{ id: "contact" },
|
|
15
|
-
{ id: "day" },
|
|
16
|
-
{ id: "month" },
|
|
17
|
-
{ id: "duration" },
|
|
18
|
-
{ id: "campaign" },
|
|
19
|
-
{ id: "pdays" },
|
|
20
|
-
{ id: "previous" },
|
|
21
|
-
{ id: "poutcome", colSpan: 2 },
|
|
22
|
-
{ id: "y" },
|
|
23
|
-
];
|
|
24
|
-
export default function CellSpansLarge({ rtl }) {
|
|
25
|
-
return _jsx(NormalLayout, { columns: columns, rtl: rtl });
|
|
26
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import NormalLayout from "./normal-layout.play.js";
|
|
3
|
-
const columns = [
|
|
4
|
-
{
|
|
5
|
-
id: "age",
|
|
6
|
-
pin: "start",
|
|
7
|
-
colSpan: (c) => {
|
|
8
|
-
return c.rowIndex === 0 ? 10 : 1;
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
|
-
{ id: "marital", pin: "start" },
|
|
12
|
-
{ id: "default" },
|
|
13
|
-
{ id: "housing", colSpan: 2 },
|
|
14
|
-
{ id: "loan" },
|
|
15
|
-
{ id: "contact", pin: "end" },
|
|
16
|
-
{ id: "day", pin: "end" },
|
|
17
|
-
{ id: "month" },
|
|
18
|
-
{ id: "duration" },
|
|
19
|
-
{ id: "campaign" },
|
|
20
|
-
{ id: "pdays" },
|
|
21
|
-
{ id: "previous" },
|
|
22
|
-
{ id: "poutcome", colSpan: 2 },
|
|
23
|
-
{ id: "y" },
|
|
24
|
-
];
|
|
25
|
-
export default function CellSpansWithPins({ rtl }) {
|
|
26
|
-
return _jsx(NormalLayout, { columns: columns, rtl: rtl });
|
|
27
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import NormalLayout from "./normal-layout.play.js";
|
|
3
|
-
const columns = [
|
|
4
|
-
{
|
|
5
|
-
id: "age",
|
|
6
|
-
colSpan: (c) => {
|
|
7
|
-
return c.rowIndex === 0 || c.rowIndex === 12 ? 3 : 1;
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
id: "job",
|
|
12
|
-
colSpan: (c) => {
|
|
13
|
-
return c.rowIndex === 2 ? 3 : 1;
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
{ id: "balance" },
|
|
17
|
-
{
|
|
18
|
-
id: "education",
|
|
19
|
-
colSpan: (t) => {
|
|
20
|
-
if (t.rowIndex === 4)
|
|
21
|
-
return 2;
|
|
22
|
-
if (t.rowIndex === 12)
|
|
23
|
-
return 2;
|
|
24
|
-
return 1;
|
|
25
|
-
},
|
|
26
|
-
rowSpan: (t) => {
|
|
27
|
-
if (t.rowIndex === 4)
|
|
28
|
-
return 3;
|
|
29
|
-
if (t.rowIndex === 8)
|
|
30
|
-
return 3;
|
|
31
|
-
if (t.rowIndex === 12)
|
|
32
|
-
return 2;
|
|
33
|
-
return 1;
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
{ id: "marital" },
|
|
37
|
-
{ id: "default" },
|
|
38
|
-
{ id: "housing", colSpan: 2 },
|
|
39
|
-
{ id: "loan" },
|
|
40
|
-
{ id: "contact" },
|
|
41
|
-
{ id: "day" },
|
|
42
|
-
{ id: "month" },
|
|
43
|
-
{ id: "duration" },
|
|
44
|
-
{ id: "campaign" },
|
|
45
|
-
{ id: "pdays" },
|
|
46
|
-
{ id: "previous" },
|
|
47
|
-
{ id: "poutcome", colSpan: 2 },
|
|
48
|
-
{ id: "y" },
|
|
49
|
-
];
|
|
50
|
-
export default function CellSpans({ rtl }) {
|
|
51
|
-
return _jsx(NormalLayout, { columns: columns, rtl: rtl });
|
|
52
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import NormalLayout from "./normal-layout.play.js";
|
|
3
|
-
const columns = [
|
|
4
|
-
{
|
|
5
|
-
id: "age",
|
|
6
|
-
colSpan: (c) => {
|
|
7
|
-
return c.rowIndex === 0 || c.rowIndex === 12 ? 3 : 1;
|
|
8
|
-
},
|
|
9
|
-
cellRenderer: () => {
|
|
10
|
-
return (_jsxs(_Fragment, { children: [_jsx("button", { tabIndex: 0, children: "A" }), _jsx("button", { tabIndex: 0, children: "B" }), _jsx("button", { tabIndex: 0, children: "C" })] }));
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
id: "job",
|
|
15
|
-
colSpan: (c) => {
|
|
16
|
-
return c.rowIndex === 2 ? 3 : 1;
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
{ id: "balance" },
|
|
20
|
-
{
|
|
21
|
-
id: "education",
|
|
22
|
-
colSpan: (t) => {
|
|
23
|
-
if (t.rowIndex === 4)
|
|
24
|
-
return 2;
|
|
25
|
-
if (t.rowIndex === 12)
|
|
26
|
-
return 2;
|
|
27
|
-
return 1;
|
|
28
|
-
},
|
|
29
|
-
cellRenderer: () => {
|
|
30
|
-
return (_jsxs(_Fragment, { children: [_jsx("button", { tabIndex: 0, children: "Prev" }), _jsx("button", { tabIndex: -1, children: "Not Tabbable" }), _jsx("button", { tabIndex: 0, children: "Next" })] }));
|
|
31
|
-
},
|
|
32
|
-
rowSpan: (t) => {
|
|
33
|
-
if (t.rowIndex === 4)
|
|
34
|
-
return 3;
|
|
35
|
-
if (t.rowIndex === 8)
|
|
36
|
-
return 3;
|
|
37
|
-
if (t.rowIndex === 12)
|
|
38
|
-
return 2;
|
|
39
|
-
return 1;
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
{ id: "marital" },
|
|
43
|
-
{ id: "default" },
|
|
44
|
-
];
|
|
45
|
-
export default function CellWithTabbables({ rtl }) {
|
|
46
|
-
return _jsx(NormalLayout, { columns: columns, rtl: rtl });
|
|
47
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import NormalLayout from "./normal-layout.play.js";
|
|
3
|
-
const columns = [
|
|
4
|
-
{
|
|
5
|
-
id: "age",
|
|
6
|
-
groupPath: ["A", "B"],
|
|
7
|
-
},
|
|
8
|
-
{ id: "marital", groupPath: ["A"] },
|
|
9
|
-
{ id: "default", groupPath: ["T"] },
|
|
10
|
-
{ id: "housing" },
|
|
11
|
-
{ id: "loan" },
|
|
12
|
-
{ id: "contact", groupPath: ["A", "B", "C"] },
|
|
13
|
-
{ id: "day", groupPath: ["A", "B"] },
|
|
14
|
-
{ id: "month", groupPath: ["A"] },
|
|
15
|
-
{ id: "duration" },
|
|
16
|
-
{ id: "campaign" },
|
|
17
|
-
{ id: "pdays", groupPath: ["C"] },
|
|
18
|
-
{ id: "previous", groupPath: ["C", "D"] },
|
|
19
|
-
{ id: "poutcome", colSpan: 2 },
|
|
20
|
-
{ id: "y" },
|
|
21
|
-
];
|
|
22
|
-
export default function ColumnGroups({ rtl }) {
|
|
23
|
-
return _jsx(NormalLayout, { columns: columns, rtl: rtl, floatingRow: true });
|
|
24
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import "./navigation.css";
|
|
3
|
-
import { useLyteNyte } from "../../state/use-lytenyte.js";
|
|
4
|
-
import { bankDataSmall } from "../test-utils/bank-data-smaller.js";
|
|
5
|
-
import { Root } from "../../root/root.js";
|
|
6
|
-
import { Viewport } from "../../viewport/viewport.js";
|
|
7
|
-
import { Header } from "../../header/header.js";
|
|
8
|
-
import { HeaderRow } from "../../header/header-row.js";
|
|
9
|
-
import { HeaderGroupCell } from "../../header/header-group-cell.js";
|
|
10
|
-
import { HeaderCell } from "../../header/header-cell.js";
|
|
11
|
-
import { RowsContainer } from "../../rows/rows-container.js";
|
|
12
|
-
import { RowsBottom, RowsCenter, RowsTop } from "../../rows/rows-sections.js";
|
|
13
|
-
import { RowHandler } from "../test-utils/row-handler.js";
|
|
14
|
-
import { useClientRowDataSource } from "../../row-data-source-client/use-client-data-source.js";
|
|
15
|
-
const baseColumns = [
|
|
16
|
-
{ id: "age" },
|
|
17
|
-
{ id: "job" },
|
|
18
|
-
{ id: "balance" },
|
|
19
|
-
{ id: "education" },
|
|
20
|
-
{ id: "marital" },
|
|
21
|
-
{ id: "default" },
|
|
22
|
-
{ id: "housing" },
|
|
23
|
-
{ id: "loan" },
|
|
24
|
-
{ id: "contact" },
|
|
25
|
-
{ id: "day" },
|
|
26
|
-
{ id: "month" },
|
|
27
|
-
{ id: "duration" },
|
|
28
|
-
{ id: "campaign" },
|
|
29
|
-
{ id: "pdays" },
|
|
30
|
-
{ id: "previous" },
|
|
31
|
-
{ id: "poutcome" },
|
|
32
|
-
{ id: "y" },
|
|
33
|
-
];
|
|
34
|
-
export default function FullWidthRows({ rtl, columns, }) {
|
|
35
|
-
const ds = useClientRowDataSource({
|
|
36
|
-
data: bankDataSmall,
|
|
37
|
-
});
|
|
38
|
-
const g = useLyteNyte({
|
|
39
|
-
gridId: "x",
|
|
40
|
-
columns: columns ?? baseColumns,
|
|
41
|
-
rowDataSource: ds,
|
|
42
|
-
rtl: rtl,
|
|
43
|
-
rowFullWidthPredicate: (r) => r.rowIndex === 2 || r.rowIndex == 4,
|
|
44
|
-
rowFullWidthRenderer: (r) => {
|
|
45
|
-
if (r.rowIndex === 2)
|
|
46
|
-
return _jsx("div", { children: "Nothing" });
|
|
47
|
-
return (_jsxs("div", { children: [_jsx("button", { tabIndex: 0, children: "A" }), _jsx("button", { tabIndex: 0, children: "B" }), _jsx("button", { tabIndex: 0, children: "C" })] }));
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
const view = g.view.useValue();
|
|
51
|
-
return (_jsxs("div", { children: [_jsx("button", { tabIndex: 0, onClick: () => { }, children: "Top Capture" }), _jsx("div", { style: { width: "100%", height: "90vh", border: "1px solid black" }, children: _jsx(Root, { grid: g, children: _jsxs(Viewport, { children: [_jsx(Header, { children: view.header.layout.map((row, i) => {
|
|
52
|
-
return (_jsx(HeaderRow, { headerRowIndex: i, children: row.map((c) => {
|
|
53
|
-
if (c.kind === "group") {
|
|
54
|
-
return _jsx(HeaderGroupCell, { cell: c }, c.idOccurrence);
|
|
55
|
-
}
|
|
56
|
-
return (_jsx(HeaderCell, { cell: c, style: {
|
|
57
|
-
paddingInline: "16px",
|
|
58
|
-
background: "light-dark(rgb(200,200,200),rgb(57, 39, 39))",
|
|
59
|
-
color: "light-dark(black,white)",
|
|
60
|
-
display: "flex",
|
|
61
|
-
alignItems: "center",
|
|
62
|
-
borderBottom: "1px solid light-dark(gray, #444242)",
|
|
63
|
-
borderRight: "1px solid light-dark(gray, #444242)",
|
|
64
|
-
} }, c.column.id));
|
|
65
|
-
}) }, i));
|
|
66
|
-
}) }), _jsxs(RowsContainer, { children: [_jsx(RowsTop, { children: _jsx(RowHandler, { rows: view.rows.top, withStyles: true, pinned: true }) }), _jsx(RowsCenter, { children: _jsx(RowHandler, { rows: view.rows.center, withStyles: true }) }), _jsx(RowsBottom, { children: _jsx(RowHandler, { rows: view.rows.bottom, withStyles: true, pinned: true }) })] })] }) }) }), _jsx("button", { tabIndex: 0, onClick: () => { }, children: "Bottom Capture" })] }));
|
|
67
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|